Make and rename a folder in batch

I don't know, I'm at the
August 12, 2007 at 04:28:00
Specs: Windows 2000, ?

I was wondering how to make and rename a folder in batch. I want it to make a folder on the desktop called folder1, and then rename it to folder2, and then rename it to folder3.

Thanks!


See More: Make and rename a folder in batch

Report •


#1
August 12, 2007 at 04:43:54

Also, is it possible to reaname it a name with a space, like folder 1?

Report •

#2
August 12, 2007 at 09:04:31

Copy and paste everything between the --'s:

--
@echo off
cls
cd \
cd %userprofile%
cd desktop
mkdir "folder 1"
rename "folder 1" "folder2"
rename "folder 2" "folder 3"
exit
--

Could I ask why you want this to happen? Perhaps you should bare in mind that the changes will be near enough instant, so all you will see is a folder beeing made called folder 3.

Hth anyway.
BEN


Report •

#3
August 12, 2007 at 14:07:27

i'm going to have some pauses. Also, what does the

"cls
cd \
cd %userprofile%
cd desktop"

do?

Thanks for your answer!


Report •

Related Solutions

#4
August 12, 2007 at 15:45:14

help cd
help cls

not quite knee surgery


=====================================
If at first you don't succeed, you're about average.

M2



Report •

#5
August 15, 2007 at 21:30:14

what does
help cd
help cls mean? am i supposed to type this in my batch program?

Report •

#6
September 9, 2007 at 06:10:35

That is just to display the usage of commands, if you do this :

help cd

... it is the same as :

cd /?

... and they both give help with the "cd" command. Replace "cd" with any known other command to get help from that command. You are not supposed to place this in a batchfile since it only displays the usage of the command, and it does not actually do anything. Type that command with any parameter other than "/?" and it will try to execute its designated feauture.

"Help" is just a command to display the usage of other commands ...


Report •


Ask Question