DCSportbikes.net  
» Help Support .NET!
DCSportbikes Premier Membership for 25$ per year. Discounts! Click here for full information.

Now available in the .NET Shop:



Get your DCSBN Gear!
» Shoutbox
Sorry, only registered users have the ability to use our real-time shoutbox to chat with other members.

Register now, it's free!
» Online Users: 384
0 members and 384 guests
No Members online
Most users ever online was 4,519, September 2, 2015 at 03:26 AM.
Go Back   DCSportbikes.net > Non-Sportbike Forums > Non-Sportbike Chat

Reply
LinkBack Thread Tools
Anyone know how to create this batch file??
Unread
  (#1)
DT
Yesssssss.....
 
DT's Avatar
 
Posts: 2,147
Join Date: June 24, 2004
Location: NYDB
Anyone know how to create this batch file?? - April 7, 2008, 12:42 PM

Windows.

Have to create a folder (done) called AFG

Have to have 2600 folders called AFG-0001 throught AFG-2600 within that folder.

How do I that without doing it 2600 times??

Thanks!


04 600RR - SOLD

"I am a soldier, I fight where I am told, and I win where I fight."
- General George Patton Jr
  Send a message via AIM to Send a message via Yahoo to DT Send a message via AIM to DT Send a message via MSN to DT Send a message via Skype™ to DT 
Reply With Quote
Unread
  (#2)
Warming up the tires
 
bike4fun's Avatar
 
Posts: 561
Join Date: October 18, 2004
Location: Ashburn, Va
April 7, 2008, 01:09 PM

FOR /L %i IN (0,1,2600) DO mkdir afg-%i

will create folders afg-0 through afg-2600

if you want the 0000, 0001, 0002, etc. then it would probably be easier to write a vbscript


naked blue 2003 SV1000
red 2014 Honda Interceptor - VFR 800

Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. - Albert Einstein
  Send a message via AIM to Send a message via Yahoo to bike4fun  
Reply With Quote
Unread
  (#3)
subUrban Warrior
 
Newzpix's Avatar
 
Posts: 1,054
Join Date: January 30, 2006
Location: N38 45.064 W77 28.282 elev 359ft
April 7, 2008, 01:11 PM

find another job


"I banged so many chicks last year my iPhone address book broke" - overheard at a Dover, DE bar
  Send a message via AIM to  
Reply With Quote
Unread
  (#4)
Ling Long
 
YaoMatt's Avatar
 
Posts: 6,183
Join Date: June 13, 2006
April 7, 2008, 01:15 PM

Quote:
Originally Posted by bike4fun
FOR /L %i IN (0,1,2600) DO mkdir afg-%i

will create folders afg-0 through afg-2600

if you want the 0000, 0001, 0002, etc. then it would probably be easier to write a vbscript
That's the exact problem I'm having. I can get it to create them afg-1 through 2600, but not 0001... Grr


U
C
Lots of
Asians
  MySpace.com Page Send a message via AIM to Send a message via Yahoo to YaoMatt Send a message via AIM to YaoMatt Send a message via MSN to YaoMatt  
Reply With Quote
Unread
  (#5)
Ling Long
 
YaoMatt's Avatar
 
Posts: 6,183
Join Date: June 13, 2006
April 7, 2008, 01:57 PM

Here's a Java script to do it. I didn't feel like playing with VB...

Run it in the directory you want the folders created in.

Quote:
import java.io.File;
import java.text.DecimalFormat;

public class GenerateAFG {
public static void main(String []args) {
String prefix = "AFG-";
File newFolder = null;

DecimalFormat myFormat = new java.text.DecimalFormat("0000");
for (int i = 1; i <= 2600; i++) {
newFolder = new File(prefix + myFormat.format(new Integer(i)));
if (!newFolder.exists())
newFolder.mkdir();
}
}
}
If you have any problems, please let me know. I ran it on my system and worked fine.


U
C
Lots of
Asians
  MySpace.com Page Send a message via AIM to Send a message via Yahoo to YaoMatt Send a message via AIM to YaoMatt Send a message via MSN to YaoMatt  
Reply With Quote
Unread
  (#6)
subUrban Warrior
 
Newzpix's Avatar
 
Posts: 1,054
Join Date: January 30, 2006
Location: N38 45.064 W77 28.282 elev 359ft
April 7, 2008, 02:00 PM

damn you guys are smart -- seriously


"I banged so many chicks last year my iPhone address book broke" - overheard at a Dover, DE bar
  Send a message via AIM to  
Reply With Quote
Unread
  (#7)
It's a Triumph thing...
 
3IsEnough's Avatar
 
Posts: 194
Join Date: June 18, 2007
Location: Chantilly, Va.
April 7, 2008, 02:22 PM

for /L %%i in (0,1,9) do mkdir afg-000%%i
for /L %%i in (10,1,99) do mkdir afg-00%%i
for /L %%i in (100,1,999) do mkdir afg-0%%i
for /L %%i in (1000,1,2600) do mkdir afg-%%i

Would also work...
  Send a message via AIM to  
Reply With Quote
Unread
  (#8)
DT
Yesssssss.....
 
DT's Avatar
 
Posts: 2,147
Join Date: June 24, 2004
Location: NYDB
April 7, 2008, 03:10 PM

YaoMatt is the shit.

Thanks for everything man - changed the end number to 9999 and we're rolling.

The boys in green thank you as well.


04 600RR - SOLD

"I am a soldier, I fight where I am told, and I win where I fight."
- General George Patton Jr
  Send a message via AIM to Send a message via Yahoo to DT Send a message via AIM to DT Send a message via MSN to DT Send a message via Skype™ to DT 
Reply With Quote
Unread
  (#9)
Ling Long
 
YaoMatt's Avatar
 
Posts: 6,183
Join Date: June 13, 2006
April 7, 2008, 03:15 PM

No problemo


U
C
Lots of
Asians
  MySpace.com Page Send a message via AIM to Send a message via Yahoo to YaoMatt Send a message via AIM to YaoMatt Send a message via MSN to YaoMatt  
Reply With Quote
Unread
  (#10)
BIG SACK RYDAHZ PRESIDENT
 
rf900r's Avatar
 
Posts: 905
Join Date: September 14, 2005
Location: BIG SACK HQ
April 7, 2008, 03:41 PM

MATT IS A GOOGLE GENIOUS
  Send a message via AIM to  
Reply With Quote
Unread
  (#11)
Owner & Creator
 
Carnage's Avatar
 
Posts: 16,418
Join Date: June 11, 2003
Location: TROLL WORLD
April 7, 2008, 04:04 PM

Thanks to my smart ass coworker who is only 20yrs old. He said he did a messy coding because he didn't really care too much about it. But here it is www.carnage-racing.com/folder.vbs right click and save it into the folder you want to make multiples of. Run the script and it will create your 2600 folders. I tried it already. If you use notepad to edit it you can see how it was created it.

Last edited by Carnage; April 7, 2008 at 04:06 PM..
  Send a message via AIM to  
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not 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 On
Pingbacks are On
Refbacks are On


Powered by vBadvanced CMPS v3.2.3


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0
vBulletin Skin developed by: vBStyles.com
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 2002-2010 by DCSportbikes.net. DCSportbikes.net is owned by End of Time Studios, LLC.