help with a vbscript to copy files to a remote computer and overwrite a file if it is already there…

15 pts.
Tags:
VBScript
VBScript Functions
I already have the script to copy the files over and it is working on my local pc. All pc's are on the same domain. Set FSO =CreateObject("scripting.FileSystemObject") FSO.CopyFile "\SAN1Files*", "c:Metatr~1" ,True
ASKED: March 18, 2009  5:27 PM
UPDATED: May 18, 2009  2:47 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I believe that the problem with your code is the source file path. You have a *. The syntex is wrong. You either need to specify the file name with extension, or use a wild card like *.*… or *.txt.

Set FSO =CreateObject(“scripting.FileSystemObject”)
FSO.CopyFile “\\SAN1\Files\File.Txt”, “c:\Metatr~1″ ,True

Set FSO =CreateObject(“scripting.FileSystemObject”)
FSO.CopyFile “\\SAN1\Files\*.*”, “c:\Metatr~1″ ,True

Set FSO =CreateObject(“scripting.FileSystemObject”)
FSO.CopyFile “\\SAN1\Files\*.Txt”, “c:\Metatr~1″ ,True

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Dlynn
    Thanks Raedyn
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following