Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Create a folder  (Read 13347 times)

0 Members and 1 Guest are viewing this topic.

Esgrimidor

    Topic Starter


    Hopeful

    Thanked: 1
    Create a folder
    « on: August 22, 2009, 01:01:28 PM »
    Create a folder

    I would like to create a folder with a script.

    This folder goes after the initial path : Y:\GAB\THEME
    The script would ask me for the name of the new folder and propose the next one in the form : 129.09 , where 129 is a sequential number from 000 to 999 and 09 is the year.

    The new folder will be  : Y:\GAB\TEMA\129.09

    ********************
    Process
    1. Ask the name of the folder. By default appears the last one + 1 . If the last one was 128, appears 129
    and a point and two last digits of the year . By example 129.09

    2. Create the folder in the prefixed path .

    Can you help me please  ?
    Thanksxx
    No dejes que tu felicidad dependa de lo que no depende de tí.

    Subash Kathet

    • Guest
    Re: Create a folder
    « Reply #1 on: August 23, 2009, 06:23:03 AM »
    how to create a new folders /

    Salmon Trout

    • Guest
    Re: Create a folder
    « Reply #2 on: August 23, 2009, 07:53:12 AM »

    billrich

    • Guest
    Re: Create a folder
    « Reply #3 on: August 23, 2009, 08:24:35 AM »

    C:\>mkdir /?
    Creates a directory.

    MKDIR [drive:]path
    MD [drive:]path

    If Command Extensions are enabled MKDIR changes as follows:

    MKDIR creates any intermediate directories in the path, if needed.
    For example, assume \a does not exist then:

        mkdir \a\b\c\d

    is the same as:

        mkdir \a
        chdir \a
        mkdir b
        chdir b
        mkdir c
        chdir c
        mkdir d

    which is what you would have to type if extensions were disabled.

    C:\>

    Esgrimidor

      Topic Starter


      Hopeful

      Thanked: 1
      Re: Create a folder
      « Reply #4 on: August 23, 2009, 11:53:44 AM »
      Understood.

      So

      @echo off
      :begin
      set pth=
      echo.
      set /p pth=Path of folder:
      if not exist "%pth%" (
      mkdir "%pth%"
      goto :PRE
      )
      echo.
      echo ERROR: Folder exists
      goto :begin

      But How can I recover the name of the path . As I told is in the form : 129.09 . 09 is part of the date. and 129 is a sequential number to remember.

      How can I propose this determination ?
      With a file, with a database file complement ?

      Thanksxx

      No dejes que tu felicidad dependa de lo que no depende de tí.

      Helpmeh



        Guru

      • Roar.
      • Thanked: 123
        • Yes
        • Yes
      • Computer: Specs
      • Experience: Familiar
      • OS: Windows 8
      Re: Create a folder
      « Reply #5 on: August 23, 2009, 07:31:04 PM »
      Well.

      Set pth=YOUR PATH HERE
      Set num1=001
      Set inc=1
      Set num2=09
      :loop
      Md %pth%\%num1%.%num2%
      Set /a num1=%num1%+%inc%
      If %num1% leq 9 set num1=00%num1% & goto loop
      If %num1% leq 99 set num1=0%num1% & goto loop
      Goto loop
      Where's MagicSpeed?
      Quote from: 'matt'
      He's playing a game called IRL. Great graphics, *censored* gameplay.

      Esgrimidor

        Topic Starter


        Hopeful

        Thanked: 1
        Re: Create a folder
        « Reply #6 on: August 23, 2009, 08:06:27 PM »
        I'll try and comment.

        Best Regards
        No dejes que tu felicidad dependa de lo que no depende de tí.

        Helpmeh



          Guru

        • Roar.
        • Thanked: 123
          • Yes
          • Yes
        • Computer: Specs
        • Experience: Familiar
        • OS: Windows 8
        Re: Create a folder
        « Reply #7 on: August 23, 2009, 08:19:13 PM »
        Ahh wait. Add this as the second-last line.
        If %num1% equ 1000 exit
        Where's MagicSpeed?
        Quote from: 'matt'
        He's playing a game called IRL. Great graphics, *censored* gameplay.

        Esgrimidor

          Topic Starter


          Hopeful

          Thanked: 1
          Re: Create a folder
          « Reply #8 on: August 24, 2009, 12:13:08 AM »
          Ah. I try again because the first time the folders has many zeros. But I'll try to understand and comments.

          thankxxxx

          No dejes que tu felicidad dependa de lo que no depende de tí.

          Helpmeh



            Guru

          • Roar.
          • Thanked: 123
            • Yes
            • Yes
          • Computer: Specs
          • Experience: Familiar
          • OS: Windows 8
          Re: Create a folder
          « Reply #9 on: August 24, 2009, 04:54:31 AM »
          Ah. I try again because the first time the folders has many zeros. But I'll try to understand and comments.

          thankxxxx


          More than 3 digits?
          Where's MagicSpeed?
          Quote from: 'matt'
          He's playing a game called IRL. Great graphics, *censored* gameplay.

          Esgrimidor

            Topic Starter


            Hopeful

            Thanked: 1
            Re: Create a folder
            « Reply #10 on: August 24, 2009, 11:27:52 AM »



            A little more than three digits....

            many of this size : 000000000000000000000000000000000000000 000000000000000000000000000000000000000 000000000000000000000000000000000000000 000000000000000000000000000000000000000 0000000000000000000000000000008

            I was looking for the screenshots I take but I have not found yet for seeing.

             ::)

            Edited : Ufff I was looking for you know (I pretended to be so organized that finally I am not organized......)




            I revised everything and try again and comment.

            Thank a lot.
            Best Regards
            « Last Edit: August 24, 2009, 11:57:24 AM by Esgrimidor »
            No dejes que tu felicidad dependa de lo que no depende de tí.

            Helpmeh



              Guru

            • Roar.
            • Thanked: 123
              • Yes
              • Yes
            • Computer: Specs
            • Experience: Familiar
            • OS: Windows 8
            Re: Create a folder
            « Reply #11 on: August 24, 2009, 06:17:24 PM »
            Hmm. Can you just post like the first 5 number sets. I had experience with set /a that it removes preceeding 0s. It may not do that on your computer (I can tell depending on the number sequence I requested)
            Where's MagicSpeed?
            Quote from: 'matt'
            He's playing a game called IRL. Great graphics, *censored* gameplay.

            Esgrimidor

              Topic Starter


              Hopeful

              Thanked: 1
              Re: Create a folder
              « Reply #12 on: August 24, 2009, 06:34:03 PM »
              I try again tomorrow and give all the possible information I can obtain. I don't know what i am doing bad. But sure finallly goes well.

               :P
              No dejes que tu felicidad dependa de lo que no depende de tí.

              Helpmeh



                Guru

              • Roar.
              • Thanked: 123
                • Yes
                • Yes
              • Computer: Specs
              • Experience: Familiar
              • OS: Windows 8
              Re: Create a folder
              « Reply #13 on: August 24, 2009, 07:07:46 PM »
              I try again tomorrow and give all the possible information I can obtain. I don't know what i am doing bad. But sure finallly goes well.

               :P
              Basically anything bad with the script is my fault, not yours. I will continue helping you until the problem is solved. 
              Where's MagicSpeed?
              Quote from: 'matt'
              He's playing a game called IRL. Great graphics, *censored* gameplay.

              smeezekitty

              • Guest
              Re: Create a folder
              « Reply #14 on: August 24, 2009, 08:04:42 PM »
              i am still confused on what you are tring to do
              hey HelpMeh do you understand this  i did this on 