1.

Solve : Rename folders??

Answer»

is it possible to make a batch files that just remove a piece of the name?
eg. "CD blabla" then i want to remove "CD " including the space.
some time its "GAME CD blabla" then i want to remove it with the two spaces " CD "Quote

is it possible to make a batch files that just remove a piece of the name?
eg. "CD blabla" then i want to remove "CD " including the space.
some time its "Game CD blabla" then i want to remove it with the two spaces " CD "

This little snippet will remove the space on the right. You can modify it to remove the space on the left.

Code: [Select]@echo on
setlocal enabledelayedexpansion
for /F "tokens=* delims=" %%x in ('dir /a:d /b') do (
SET input="%%x"
set input=!input:cd =!
ren "%%x" !input!
)


Hope this helps. Quote from: Sidewinder on June 11, 2008, 03:12:20 AM
Quote
is it possible to make a batch files that just remove a piece of the name?
eg. "CD blabla" then i want to remove "CD " including the space.
some time its "Game CD blabla" then i want to remove it with the two spaces " CD "

This little snippet will remove the space on the right. You can modify it to remove the space on the left.

Code: [Select]@echo on
setlocal enabledelayedexpansion
for /f "tokens=* delims=" %%x in ('dir /a:d /b') do (
set input="%%x"
set input=!input:cd =!
ren "%%x" !input!
)


Hope this helps.



THANK You! it realy helped!
+karma


Discussion

No Comment Found