0

In error, I restored a large amount of files, and selected if the file exists restore with a different file name. All the files restored end in (1) . For example test.pdf would be restored as test(1).pdf. The result is two identical files with different names

Is there a XCOPY command or other DOS command that will search the drive and its subfolders for file names that end in (1), and move those files into a temp folder. If so, it would be greatly appreciated if you could give me the command line info

Thanks

Mark
  • 3,609
  • 1
  • 22
  • 33
  • possible duplicate of [xcopy file, rename, suppress "Does xxx specify a file name..." message](http://stackoverflow.com/questions/3018289/xcopy-file-rename-suppress-does-xxx-specify-a-file-name-message) –  Aug 23 '13 at 17:28
  • 1
    Does it really need to be a 16-bit DOS command? If you're using Windows, you could open a Windows Explorer window, search your drive for all files named `*(1).*`, and then drag the search results wherever you want. – jamesdlin Aug 23 '13 at 17:41

1 Answers1

1

you can try this:

for /f "delims=" %%a in ('dir /b /a-d /s "*(*)*" ^| findstr "([0-9][0-9]*)\."') do ECHO MOVE "%%~fa" "c:\temp"

It searches recursively in the start folder and all subfolders and moves "([0-9][0-9]*)\." files to c:\temp. Look at the output and remove ECHO if it looks good.

Endoro
  • 37,015
  • 8
  • 50
  • 63