Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
how to create a bat file that renames folder
on the c drive c\program files\new folderi want to rename new folder

To rename a Folder under XP use the Move command at prompt.
To know more type Move /? and embed your path between quotes (") if that contains blanks (e.g. "C:\program files\new folder").

It's a lot easier to open Windows Explorer, find the folder you want to rename, right click on it, go to Rename...and, well, rename it.

Yes I agree with salgolf that Windows Explorer will do just that but do not rename any folder installed by a program. If you do, you may run into awful lot of problems.
i_XpUser

XP is right. I should have said that, although many folders can be renamed without issue. I have a My pix folder with lots of subfolders. I could change any of those without causing a problem.
On the other hand, I wouldn't try renaming Windows/Sytem32! LOL

make a txt file in your route directory (c:)
in the txt file type :-
rename c:\progra~1\newfol~1 mynewfoldersave and rename to .bat rather than .txt run it , it will rename "new folder" to mynewfolder << change this to what u want.
ok couple of things to note:-
1: only 8 characters allowed if its longer than 8 then u have to have 6 + ~1 hence program files becomes progra~1
2: spaces do not count hence new folder becomes newfol~1 << space taken out still longer than 8 so 6 characters used and ~1 added to the end.the 8 characters does not seem to count for the new name but im not sure how to get a space in it hence mynewfolder rather than my new folder.
must admit r/click and rename in windows is alot easier unless you specifically need this way :).

whoops ok showing my age and the old dos techniques lol. typing this in the batch file also works.
rename "c:\program files\new folder" "my new folder"
looks clearer plus it gives you your spaces if needed in the new name.
erm can you not edit your posts on this forum, cant see an option anywhere ?

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |