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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileCopy won't work!

Status
Not open for further replies.

LeanneGodney

Technical User
Mar 7, 2002
175
GB
HI there,

I need to copy all files and subfolders from a server folder to a local folder. I'm using the following code but it doesn't work, and says the path doesn't exist, but it does!

FileCopy "\\Trainserver\Evaluation\Exercises\word\AutoText.doc", "c:\My Documents\"

What am I doing wrong??

Thanks in advance,
Leanne
 
You need to specify filenames, not foldernames to filecopy. In order to include all files and all subfolders, you will need to recursively drill down into your folder hierarchy, copying a single file at a time.
nick bulka

 
First question to ask - do you have wufficient rights to the server.

Is the folder you wish to copy from set up with a different share name
 
If you don't want to do the copy a single file at a time, take a look at the FilesystemObject from Windows Scripting Host.
 
Yep - I agree with Woodlark - FSO is the way to go - it basically allows you to do anything you can do with Windows Explorer.
Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top