Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Renaming multiple files
Name: willwak Date: September 27, 2004 at 02:35:33 Pacific OS: win 2000 pro CPU/Ram: 128
Comment:
I would like help with a dos batch file program that renames multiple filenames of 8 characters long to filenames of 7 characters long without changing the last four characters. e.g 00070011.rrt should be: BCX0011.rrt 00070012.rrt should be: BCX0012.rrt 00070013.rrt should be: BCX0013.rrt ..and so on. the script should actually remove the first zero in the filenames as in the example. Thanx in advance
Name: IVO Date: September 27, 2004 at 06:33:51 Pacific
Reply:
The following script achieves your wishes:
@Echo Off
For %%A in (%~f1\*.rrt) Do Call :REN %~f1 %%A GoTo :EOF
:REN Set File=%~nx2 Ren %~f1\%File% BCX%File:~4% GoTo :EOF
To run save it as XRen.bat then type XRen Folder_Name where Folder_Name is the directory holdings your rrt files to be renamed (the directory's name must not have embedded spaces).
By the way that is a NT-batch as Win NT/2K/XP have no DOS at all and the prompt is actually the NT-system console while DOS is emulated by NTVDM (DOS Virtual Machine).
0
Response Number 2
Name: IVO Date: September 27, 2004 at 07:12:55 Pacific
Summary: Hi I need to rename multiple files with a *.xls extension into file names which have a sequential number. E.g. tony.xls --> 1.xls paul.xls --> 2.xls mary.xls --> 3.xls robert.xls --> 4.xls . . . I fou...
Summary: I want to rename multiple files in dos, file01.00 -> file01.rar file02.00 -> file02.rar...and so on But write an exe program or script in notepade and run it in dos. i remember seeing 'echo' for every...
Summary: I have to rename multiple files. original file name: os_work_465.jpg to os_comp_465.rtf os_work_466.jpg to os_comp_466.rtf. and so on. In short I have to replace work by comp and *.jpg or *.pdf exten...