Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch file to copy from local drive to net share.  (Read 3992 times)

0 Members and 1 Guest are viewing this topic.

Randy Bonn

  • Guest
Batch file to copy from local drive to net share.
« on: October 25, 2004, 07:28:27 AM »
I have the following batch file that I would like to modify too copy the files that it lists in the Allfiles.txt file to the U:\. Can anyone assist with the proper syntax.

c:
dir c:\*.doc, *.xls, *.ppt, *.pab, *.pst, *.mab, *.rtf, *.pdf, *.mdb /s /b>c:\Cdrive.txt
d:
dir d:\*.doc, *.xls, *.ppt, *.pab, *.pst, *.mab, *.rtf, *.pdf, *.mdb /s /b>c:\Ddrive.txt
e:
dir e:\*.doc, *.xls, *.ppt, *.pab, *.pst, *.mab, *.rtf, *.pdf, *.mdb /s /b>c:\Edrive.txt

c:
type cdrive.txt>allfiles.txt
type ddrive.txt>>allfiles.txt
type edrive.txt>>allfiles.txt

u:
md MyDocs_oldPC

cd MyDocs_oldPC

md %username%

cd %username%

md favorites
md personal
md desktop


c:

cd\

cd winnt\profiles\%username%

xcopy /s favorites u:\mydocs_oldpc\%username%\favorites
del /Q /s favorites

scruge

  • Guest
Re: Batch file to copy from local drive to net sha
« Reply #1 on: October 25, 2004, 07:46:14 AM »
its been awhile since i used the "FOR IN DO"  but i think you can copy using it ex.

FOR c:\*.pdf DO copy d:\*.*

I've never worked with the IN set so I'm not sure how the set must be structured.