Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy a file to folder script - HELP!

Status
Not open for further replies.
Aug 14, 2003
94
US
I'm trying to create a VBscript that will copy a file from a shared network folder to a specified folder on c:

Any Ideas?
 
Set aFile = FSO.GetFile("\\server1\share\file.txt")
aFile.Copy "c:\test\", True
 
or you might prefer

FSO.CopyFile "\\server1\share\file.txt", "c:\test\", True

be careful with the \ at the end of test, i can never remember if you need the trailing \ or not. if you get it wrong you will get a 'permission denied' error
 
I tried the following, it works locally need to test with users and group policy

Const OverwriteExisting = TRUE

Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.CopyFile "\\FSO\ScriptLog.txt" , "c:\Archive\", OverwriteExisting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top