Search code examples
windowsbatch-filerenamebatch-rename

What is wrong with this batch command?


So on the Utorrent site, it says we can rename unfinished bitcomet files and remove the .bc! extension with this batch command. But it doesn't seem to work for me.

@for /r %i in (*.bc!) do @move "%~fi" "%~dpni"

I get this error :

The following usage of the path operator in
substitution is invalid: %~dpni"

For valid formats type CALL /? or FOR /?
rename.bat was unexpected at this time.

Other people have reported success with it so it is frustrating me. I am using Windows 7 Home Premium x64


Solution

  • in a batch file, you have to replace all %in FORparameters with %%

    @for /r %%i in (*.bc!) do @move "%%~fi" "%%~dpni"