Saved Bookmarks
| 1. |
Solve : help with a .bat file? |
|
Answer» Quote if *_std.idx( not sure what you think this will do? Anyhow, I use this modified version (changed line in blue) @echo off set thisdir=%cd% Echo Scanning subfolders for /f "delims=" %%D in ('DIR /b /ad') do ( echo Entering subfolder: %%D cd /d "%%D" Echo Renaming *_std to *_std.mpg if exist *_std ( for /f "delims=" %%S in ( ' dir /b *_std ^| FIND /v "_std.idx" ' ) do ( echo Renaming %%S to %%S.mpg ren "%%S" "%%S.mpg" ) ) ELSE ( echo *_std : no files to process ) Echo Renaming 2-* to 9-* to 02-* to 09-* for %%N in (2 3 4 5 6 7 8 9) do ( if exist "%%N-*" ( for /f "delims=" %%F in ('dir /b %%N-*') do ( echo Renaming %%F to 0%%F ren "%%F" "0%%F" ) ) else ( echo %%N-* : no files to process ) ) cd /d %thisdir% ) pause Quote from: xfusion on December 14, 2009, 12:48:20 PM then again, wouldn't this work? Why not give it a try? |
|