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

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.

Make and rename a folder in batch

Reply to Message Icon

Name: grayhuskie53
Date: August 12, 2007 at 04:28:00 Pacific
OS: Windows 2000
CPU/Ram: ?
Product: 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!



Sponsored Link
Ads by Google

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

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


0

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

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


0

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

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

"cls
cd \
cd %userprofile%
cd desktop"

do?

Thanks for your answer!


0

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

help cd
help cls

not quite knee surgery


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

M2



0

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

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


0

Related Posts

See More



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

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 ...


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Make and rename a folder in batch

move folder in batsch? www.computing.net/answers/programming/move-folder-in-batsch/17710.html

Help needed renaming a file in DOS www.computing.net/answers/programming/help-needed-renaming-a-file-in-dos/12770.html

Find and replace a string in a file www.computing.net/answers/programming/find-and-replace-a-string-in-a-file/19034.html