Batch file
How can I create a batch file that will search the local drive for any .XLS .DOC .PDF files in NT,98,95 and copy them to a folder on the network.
Can someone help me out.
Windows Forum
How can I create a batch file that will search the local drive for any .XLS .DOC .PDF files in NT,98,95 and copy them to a folder on the network.
Can someone help me out.
by rbgnr111
xcopy /s /e *.xls N:\dir
xcopy /s /e *.doc N:\dir
xcopy /s /e *.pdf N:\dir
substitute the drive mapping and the dir for N:\dir
by loudeb
by ben112
Try this:
xcopy c:\*.xls N:\dir /e /k
see this page for more switches:
http://www.computerhope.com/xcopyhlp.htm#04
by ben112
by ben112
by loudeb
It copies all the Dir that the files I am looking for are in.
Thank You
by dnme
to find your files with the given extensions at the command prompt or in a batch file type the following;
dir /s c:\*.doc *.xls *.pdf
the s switch looks through sub directories.
as for the backing up... i'll get back to you later.
(using Windows NT)
by loudeb
by dnme
rem you can use this command if you wish but it is not necessary if you use the 'i' switch
md d:\mark\test
rem line 4 copies any doc files and moves them to the specified directory, in this case d:\mark\test
xcopy c:\*.doc /s /i d:\mark\test >> C:\WINNT\Profiles\internet2\Desktop\xcopylst.txt
rem line 6 copies any pdf files and moves them to the specified directory, in this case d:\mark\test
xcopy c:\*.pdf /s /i d:\mark\test >> C:\WINNT\Profiles\internet2\Desktop\xcopylst.txt
rem line 8 copies any doc files and moves them to the specified directory, in this case d:\mark\test
xcopy c:\*.xls /s /i d:\mark\test >> C:\WINNT\Profiles\internet2\Desktop\xcopylst.txt
rem In each case the output is placed into the file xcopylst.txt, I use this as a log file myself but
rem again it is not necessary.
rem Switches - s = include subdirectories, i = assume (and create) directory
rem The l switch can be used to get a list of all the given file types without copying them (kinda test)
rem Once completed you can carry out your backup as per normal and include the new directory.
rem Finally, to copy over a network check out the following switch;
rem /z "Copies over a network in restartable mode."
rem This should work on win95/98 but has not been tested on them.
rem Hope this saves you loads of time and hassle - enjoy.
rem Mark
I sometimes wonder if you have given up on an answer to this one!!
by loudeb
by loudeb
This discussion is closed to new replies.
Sort by Trending