Solved Batch rename in windows

June 21, 2012 at 04:05:38
Specs: Windows 7
batch rename 'doc nº xxx Nom Surnom.doc' to 'xxx.doc'

See More: Batch rename in windows

Report •

June 21, 2012 at 07:42:36
✔ Best Answer
::please note this was set up as a drag and drop / file as first parameter
@echo off
::batch rename 'doc nº xxx Nom Surnom.doc' to 'xxx.doc'
::note lazyness was applied
::not really tested, so check it first - mike
set file=%~nx1
::removes spaces
set file=%file: =%
::removes all but 16 charactors
set file=%file:~-16%
::sets file as the first three of file
set file=%file:~0,3%
::renames origional to
ren %1 %file%.doc

:: mike

Report •
Related Solutions

Ask Question