Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Batch file to rename multiple dir's
Name: Matt Date: December 15, 2003 at 18:43:30 Pacific OS: Win2000 CPU/Ram: 1.8G 512MB
Comment:
I want to change all the folder names in a directory so that they all start with the same 3 digit number. For Example, current folder names are 12345, 23456, 34567. I want to change them to 18045, 18056, 18067, etc. If they were files, I could use ren ???*.* 180*.*. Does anyone know of a similar command for the folders? Thanks for the help.
For /F %%a in ('Dir /B /AD-H %1') Do Call :REN %%a GoTo :EOF
:REN Set RDir=%* Set RDir=%Str%%RDir:~3% Echo Move "%Fld%\%*" "%Fld%\%RDir%" GoTo :EOF
Type "XRDir Folder String" where Folder is the directory storing the subfolders to be renamed and String the three characyers to be replaced at the beginninig of folder's name (blanks not allowed in folder's name).
Activate the script removing the Echo in front of Move command; do it only when sure it works fine.
Summary: Maybe someone on this site can help me. I need a batch file to rename files. The way it needs to work is: you open the batch file and it asks you to pick the kind of files you want renamed, (lets say ...
Summary: I want to write a dos batch file to change the name a file from its original name to a timestamp (e.g., the key command would be: ren file.txt mmddhhmm.txt so if the .bat file runs at 1:30 pm on Dec. ...
Summary: I have a large directory of .bmp files and each day I need to randomly select 20 of these files and rename them in a consistent way (e.g., pic1.bmp, pic2.bmp). I would appreciate any help in writing a...