Computer Hope

Microsoft => Microsoft Windows => Windows XP => Topic started by: scanman on November 19, 2007, 09:41:02 AM

Title: Create a batch file to save files from network to local computer
Post by: scanman on November 19, 2007, 09:41:02 AM
I made a .bat file that seems to do the first stuff correct, but when it comes to finding the network stuff it just can't. Really new to this so be gentle.

This is the code I used...

mkdir D:\BATCH_BACKUPS\PC-DMIS\PROGRAMS

xcopy X:\PCDMIS PROGRAMS\212 LAYOUT PROGRAMS *.* D:\BATCH_BACKUPS\PC-DMIS\PROGRAMS/y/e

Thanks for any help. If more info is needed please ask me.
Title: Re: Create a batch file to save files from network to local computer
Post by: Spoiler on November 19, 2007, 10:47:16 AM
mkdir D:\BATCH_BACKUPS\PC-DMIS\PROGRAMS


If the directory called programs is all ready there than you don't need to do this everytime you run the bat file. make it once and call it a day.

xcopy X:\PCDMIS PROGRAMS\212 LAYOUT PROGRAMS *.* D:\BATCH_BACKUPS\PC-DMIS\PROGRAMS/y/e

Do you have a network mapped drive called X? Or are you trying to create it when you run the bat file? I think what your after is something like this...


net use X: "\\YOUR SERVER\THE SHARE NAME\*.*" /PERSISTENT:NO

xcopy "X:\PCDMIS PROGRAMS\212 LAYOUT PROGRAMS\ *.*" D:\BATCH_BACKUPS\PC-DMIS\PROGRAMS\*.* /y/e

You may also want to post this in the dos forum.




Title: Re: Create a batch file to save files from network to local computer
Post by: scanman on November 19, 2007, 11:01:56 AM
Thanks Spoiler, I will try this later today.