1.

Solve : Batch file to copy from local drive to net share.?

Answer»

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 favoritesits 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.



Discussion

No Comment Found