#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Posts
    27
    Rep Power
    0

    Batch File to Create Folders


    Ok I know how to create a folder using the MKDIR command. But I need some ideas how to have a user input a project number and then create that folder in the location I give them using the porject number they input.

    Any ideas?
  2. #2
  3. Providing fuel for space ships
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2004
    Location
    nr Edinburgh, Scotland
    Posts
    14,382
    Rep Power
    3848
    Can you provide a little more information on this please ?

    Do you mean you need a batch file that asks the user for input and when they input a number, it will create a folder in a location for that specified input ?
    The No Ma'am commandments:

    1.) It is O.K. to call hooters 'knockers' and sometimes snack trays
    2.) It is wrong to be French
    3.) It is O.K. to put all bad people in a giant meat grinder
    4.) Lawyers, see rule 3
    5.) It is O.K. to drive a gas guzzler if it helps you get babes
    6.) Everyone should car pool but me
    7.) Bring back the word 'stewardesses'
    8.) Synchronized swimming is not a sport
    9.) Mud wrestling is a sport
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Posts
    27
    Rep Power
    0
    Yes that is correct.

    So if I enter 12345 it will create a folder on C:\Temp\12345
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Location
    Finland
    Posts
    260
    Rep Power
    21
    Code:
    @echo off
    cls
    mkdir C:\Temp\%1
    %1 is the first argument user types within the file call, ie if you call the file let's say makedirectory.bat with argument LOLDELME it creates directory C:\Temp\LOLDELME

    Wasn't that easy
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Posts
    27
    Rep Power
    0
    I think I am missing some other code, not sure though. Where does the %1 get added so the user can input their new folder name?

    Originally Posted by KillerRabbit
    Code:
    @echo off
    cls
    mkdir C:\Temp\%1
    %1 is the first argument user types within the file call, ie if you call the file let's say makedirectory.bat with argument LOLDELME it creates directory C:\Temp\LOLDELME

    Wasn't that easy

IMN logo majestic logo threadwatch logo seochat tools logo