04 octubre, 2010

Remove characters from files/directories in DOS

This piece of code, will list all files/directories where it's standing, and rename all of them to the same, but removing the first two characters...

> for /F "usebackq delims==" %a in (`dir /b`) do ( @echo %a && set TEST=%
a && move "!TEST!" "!TEST:~2!")

No hay comentarios.: