Create Windows folders batch file - Overclock.net - An Overclocking Community
Forum Jump: 

Create Windows folders batch file

Reply
 
Thread Tools
post #1 of 23 (permalink) Old 07-15-2008, 05:43 AM - Thread Starter
 
Join Date: Dec 2007
Location: Ireland
Posts: 344
Hi

I was wondering if anyone might have code to create a set of folders from a batch file or even an .exe, the file name would obviously need to be edited regularly so I'm guesses a batch file is the way to go. If anyone can help it would be great.

Thanks
Badger.flynn is offline  
Sponsored Links
Advertisement
 
post #2 of 23 (permalink) Old 07-15-2008, 05:44 AM
Retired Staff
 
stanrc's Avatar
 
Join Date: Apr 2007
Location: Stafford, VA
Posts: 5,713
Rep: 280 (Unique: 217)
stanrc is offline  
post #3 of 23 (permalink) Old 07-15-2008, 05:56 AM - Thread Starter
 
Join Date: Dec 2007
Location: Ireland
Posts: 344
Thanks a million, anything I need to do?
Badger.flynn is offline  
Sponsored Links
Advertisement
 
post #4 of 23 (permalink) Old 07-15-2008, 05:57 AM
Retired Staff
 
stanrc's Avatar
 
Join Date: Apr 2007
Location: Stafford, VA
Posts: 5,713
Rep: 280 (Unique: 217)
Quote:
Originally Posted by Badger.flynn View Post
Thanks a million, anything I need to do?

Just give me a better description of what you want it to do


stanrc is offline  
post #5 of 23 (permalink) Old 07-15-2008, 05:57 AM
OVERCLOCK IT OR DIE
 
Join Date: May 2006
Location: USA
Posts: 7,323
Rep: 586 (Unique: 375)
Batch File:


wont let me do \\ in the code box

mkdir "c:\\path\\foldername

I use AMD, Intel, ATI, Nvidia, Mac OS, Windows, Debian, and Unix. There is no right or wrong way to love computers.
Miranda
(16 items)
CPU
Intel Core i7 3700
Motherboard
ASRock Z77 Extreme44
GPU
AMD Radeon R9 390
RAM
Crucial Ballistix Tracer
Hard Drive
Samsung SSD 850 EVO 500GB
Hard Drive
Western Digital WD50000LPLX
Optical Drive
LiteON DVD/CD Burner
Power Supply
Silverstone SST-ET650-B
Cooling
Artic Freezer i11
Case
PC Voodoo Rage
Operating System
Windows 10 Professional
Monitor
RCA 32" 1080p
Monitor
RCA 32" 1080p
Monitor
LG 32" 1080p
Keyboard
Cooler Master Devastator II
Mouse
Cooler Master Devastator II
▲ hide details ▲


Modki is offline  
post #6 of 23 (permalink) Old 07-15-2008, 06:00 AM
Retired Staff
 
stanrc's Avatar
 
Join Date: Apr 2007
Location: Stafford, VA
Posts: 5,713
Rep: 280 (Unique: 217)
Quote:
Originally Posted by Modki View Post
Batch File:


wont let me do in the code box

mkdir "cathfoldername
Yeah, that pretty much sums it up


stanrc is offline  
post #7 of 23 (permalink) Old 07-15-2008, 06:04 AM - Thread Starter
 
Join Date: Dec 2007
Location: Ireland
Posts: 344
Simply need to create a set of say 10 or so default folder names with one folder being the root and the other 9 being sub folders. These folders would start with a numeric number that would change every time, say for example you might have "06123 OutGoing Mail" next time the I run the batch I would need to change the Name to "06164 OutGoing Mail" the path would also change.

Thanks in advance for the help
Badger.flynn is offline  
post #8 of 23 (permalink) Old 07-15-2008, 06:10 AM
Retired Staff
 
stanrc's Avatar
 
Join Date: Apr 2007
Location: Stafford, VA
Posts: 5,713
Rep: 280 (Unique: 217)
something like this:

@echo off
mkdir c:\\Mail <-- change that as needed
mkdir c:\\Mail\\Outgoing 1
mkdir c:\\Mail\\Outgoing 2
mkdir c:\\Mail\\Outgoing 3
mkdir c:\\Mail\\Outgoing 4
mkdir c:\\Mail\\Outgoing 5
mkdir c:\\Mail\\Outgoing 6
mkdir c:\\Mail\\Outgoing 7
mkdir c:\\Mail\\Outgoing 8
mkdir c:\\Mail\\Outgoing 9

Then just manually change the folder names as needed.


stanrc is offline  
post #9 of 23 (permalink) Old 07-15-2008, 06:23 AM - Thread Starter
 
Join Date: Dec 2007
Location: Ireland
Posts: 344
That brilliant, would you know how to get the batch file to ask for the folder names to be inputed when it is run, obviously this would make it alot more useful.

Again thanks a million for you help
Badger.flynn is offline  
post #10 of 23 (permalink) Old 07-15-2008, 06:41 AM
Retired Staff
 
stanrc's Avatar
 
Join Date: Apr 2007
Location: Stafford, VA
Posts: 5,713
Rep: 280 (Unique: 217)
After some research I found this:

Quote:
Batch files can only handle parameters %0 to %9

%0 is the program name as it was called,
%1 is the first command line parameter,
%2 is the second command line parameter,
and so on till %9.
so you could replace the code I gave you above with something like:

@echo off
mkdir c:\\Mail <-- change that as needed
mkdir c:\\Mail\\%1
mkdir c:\\Mail\\%2
mkdir c:\\Mail\\%3
mkdir c:\\Mail\\%4
mkdir c:\\Mail\\%5
mkdir c:\\Mail\\%6
mkdir c:\\Mail\\%7
mkdir c:\\Mail\\%8
mkdir c:\\Mail\\%9

so when you run the program, just type:

programname foldername1 foldername2 etc...


stanrc is offline  
Reply

Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the Overclock.net - An Overclocking Community forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.
User Name:
If you do not want to register, fill this field only and the name will be used as user name for your post.
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself.
Email Address:

Log-in



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off