/build/static/layout/Breadcrumb_cap_w.png

Copying using FileSystemObject

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   [ + ] Show comments

Answers (2)

Posted by: krpa 13 years ago
Senior Yellow Belt
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.
Posted by: squeakstar 13 years ago
Orange Senior Belt
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!
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ