/bundles/itninjaweb/img/Breadcrumb_cap_w.png
The code herein attemts to copy a file from the network to a user's PC, but fails with message saying Bad file name or number. The error code from WSH is 800A004C. I cant see what is wrong with my code to get this error. Any ideas ?? I should also mention I am running the code from a local machine not from the network.

Dim objFSO
Dim scurPath

Set objFSO = CreateObject("Scripting.FileSystemObject")
sCurPath = CreateObject("Scripting.FileSystemObject").GetAbsolutePathName(".")
objFSO.CopyFile chr(34) & sCurPath & "\mapinfow.prj" & Chr(34),Chr(34) & "C:\Program Files\Mapinfo\Professional\" & Chr(34), True
0 Comments   [ - ] Hide Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity

Answers

0
I have found my problem: Code should be..objFSO.CopyFile sCurPath & "\mapinfow.prj", "C:\Program Files\Mapinfo\Professional\", True

Still have an issue getting it to run on Win7 due to admin rights, but I am working on that.
Answered 01/24/2011 by: krpa
Senior Yellow Belt

Please log in to comment
0
ORIGINAL: krpa

I have found my problem: Code should be..objFSO.CopyFile sCurPath & "\mapinfow.prj", "C:\Program Files\Mapinfo\Professional\", True

Still have an issue getting it to run on Win7 due to admin rights, but I am working on that.





The directory will need "user" modify/write permissions!
Answered 01/25/2011 by: squeakstar
Orange Senior Belt

Please log in to comment