1.

Solve : Searching for a file in DOS, then moving it.?

Answer»

Alright, so an EXCEL spreadsheet was given to a lot of people on my network, but I need to make a change to that spreadsheet. What I need is to create a batch file that looks under the the C: drive and under every sub-directory for a ceratin .XLS file, move it from that location to just a temp folder so that I can then transfer it to my computer (I use a DIFFERENT program for that) and edit it. After that point I'll be able to re-email them the correct spreadsheet. Any help would be great.
Thanks!cd\folder
for /f "tokens=1*" %%a in ('dir %CD:~0,1%\yourfile.XLS /b /s') do move %%a After doing more searching (my first SEARCHES didn't come up with great results, why I posted) but I was able to put together the FOLLOWING for this:

For /f "tokens=* delims=" %%a in ('dir C:\ /a /b /s ^| find /i "The Spreadsheet.XLS"') do move "%%a" C:\Folder

This worked perfectly for FINDING all files with that name to my folder.
Thanks!



Discussion

No Comment Found