Computing.Net > Forums > Programming > Make and rename a folder in batch

Make and rename a folder in batch

Reply to Message Icon

Original Message
Name: grayhuskie53
Date: August 12, 2007 at 04:28:00 Pacific
Subject: Make and rename a folder in batch
OS: Windows 2000
CPU/Ram: ?
Model/Manufacturer: I don't know, I'm at the
Comment:

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!


Report Offensive Message For Removal


Response Number 1
Name: grayhuskie53
Date: August 12, 2007 at 04:43:54 Pacific
Reply: (edit)

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


Report Offensive Follow Up For Removal

Response Number 2
Name: bmustillrose
Date: August 12, 2007 at 09:04:31 Pacific
Reply: (edit)

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 Offensive Follow Up For Removal

Response Number 3
Name: grayhuskie53
Date: August 12, 2007 at 14:07:27 Pacific
Reply: (edit)

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

"cls
cd \
cd %userprofile%
cd desktop"

do?

Thanks for your answer!


Report Offensive Follow Up For Removal

Response Number 4
Name: Mechanix2Go
Date: August 12, 2007 at 15:45:14 Pacific
Reply: (edit)

help cd
help cls

not quite knee surgery


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

M2



Report Offensive Follow Up For Removal

Response Number 5
Name: grayhuskie53
Date: August 15, 2007 at 21:30:14 Pacific
Reply: (edit)

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


Report Offensive Follow Up For Removal


Response Number 6
Name: User123456789
Date: September 9, 2007 at 06:10:35 Pacific
Reply: (edit)

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 Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Make and rename a folder in batch

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge