Results 1 to 2 of 2

Thread: Batch file : How to create folders with user input

  1. #1
    Join Date
    May 2012
    Posts
    2

    Batch file : How to create folders with user input

    Hello all

    Short background

    I am rendering support to investigators who take photo's at crimes scenes. These photos are then downloaded and authenticated by software that writes image identifiers and water marks etc. Any how. Before the images can be verified they need to be transferred from the SD card to the PC before they can be authenticated.

    The directory structures are as follow :

    D:\Images\Crime Scene Images

    Then residing in the above folder we have a Master and working Folder. So the structure looks like this :

    D:\Images\Crime Scene Images\Master
    D:\Images|Crime Scene Images\Working

    The above folders are always the same and never change. Now comes the tricky part, for each photographer there needs to be the following folders :

    D:\Images\Crime Scene Images\Master\Photographer 1
    D:\Images|Crime Scene Images\Working\Photographer 2
    etc
    etc
    I am just using the name Photographer 1 etc but in real life is will either be his badge number or surname.

    Inside those folders there needs to be sub folders for each case attended. Usually the case only consists of digits, so the structure looks like this :

    D:\Images\Crime Scene Images\Master\Photographer 1\Case number 1
    D:\Images|Crime Scene Images\Working\Photographer 2\Case number 1

    Essentially you want the same sub folders in both the Master and Working folder.

    The members who downloads the SD cards and do the authentication, is well, uhm.......struggling to comprehend how to make the folder, while others just do their own thing not following the SOP.

    I the program called Autorun menu studio where you can build a interface with buttons and you can assign different commands to those buttons, ranging from running a script to running a file.

    So here is what I want to try and do to make the life of the members a bit easier and perhaps same them some time.

    I want to try and make a batch file that will run when you click on one of the buttons that will prompt the member for a photographer name and case number. The batch file will then create the necc folder structure as mentioned above.

    I found a batch file that I managed to edit but I was only able to get it to work up till the members name, I have no clue how to go further that it will create a sub folder on the member's name with the relevant case number.

    My batch file I have thus far looks like this :

    @echo off
    cls
    SET /P mname=[ENTER MEMBERS SURNAME WITHOUT ANY SPACES OR USE _ FOR SPACE]
    MKDIR d:\images\crimes~1\master\%mname%
    MKDIR d:\images\crimes~1\working\%mname%
    I used the short dos name for crime scene images hence the crimes~1 in the md command.

    Any ideas how I can get the case number under the photographers name too so that when the batch file runs, it asks for the photographers name , creates the folder in the Master / Working folder, then the batch file asks for the case number, and the batch file will create the case number under the photographers name.

    Hope my explanation is clear since I know that I suck at explaining things

    It would make a lot of people very happy.

    Thank you for any help.

  2. #2
    Join Date
    May 2012
    Posts
    2

    Re: Batch file : How to create folders with user input

    I finally figured it out, by using the set/p commands with two variables then substituting the variables in the following command I got it to create the folders using the user input.

    MKDIR d:\Images\"Crime Scene Images"\Master\"%surname% %initials%"\%lcrc%%month%%year%\

    MKDIR d:\Images\"Crime Scene Images"\Working\"%surname% %initials%"\%lcrc%%month%%year%\

    I also found that using " in the Crime Scene Images sub folder I do not need to use the shorter name crimes~1 when creating the folder with the batch file.

    Only one last question ........ is there a way to loop back if a user inputs a blank ?

    I actually managed to create a nameless folder with the batch file. Getting rid of the folder was a pain.

Similar Threads

  1. I want to create a TCP/IP Batch file
    By aladdin in forum Software Development
    Replies: 1
    Last Post: 14-02-2012, 11:59 PM
  2. Replies: 3
    Last Post: 11-01-2012, 07:25 AM
  3. Help me create this batch file.
    By bomblast in forum Windows Software
    Replies: 1
    Last Post: 31-10-2011, 10:47 AM
  4. Create a .bat file to get input
    By Saaz in forum Operating Systems
    Replies: 4
    Last Post: 17-08-2009, 10:38 PM
  5. How to create a Batch file
    By Katty in forum Software Development
    Replies: 1
    Last Post: 10-01-2009, 01:26 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,499,749.96982 seconds with 17 queries