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?

Code: [SELECT]@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
ren *_std *_std.mpg
Echo renaming 2 to 02
ren 2-* 02-*
ren 3-* 03-*
ren 4-* 04-*
ren 5-* 05-*
ren 6-* 06-*
ren 7-* 07-*
ren 8-* 08-*
ren 9-* 09-*


cd /d %thisdir%

)

pause
less informative

Why not give it a try?


Discussion

No Comment Found