Home / Microsoft / Microsoft DOS / Create a folder
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 3  All - (Bottom) Print
Author Topic: Create a folder  (Read 3163 times)
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« 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
IP logged

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



Posts: 1


« Reply #1 on: August 23, 2009, 06:23:03 AM »

how to create a new folders /
IP logged
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #2 on: August 23, 2009, 07:53:12 AM »

how to create a new folders /



???
IP logged


Proud to be European
billrich
Guest
« 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:\>
IP logged
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« 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

IP logged

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



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« 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
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #6 on: August 23, 2009, 08:06:27 PM »

I'll try and comment.

Best Regards
IP logged

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



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #7 on: August 23, 2009, 08:19:13 PM »

Ahh wait. Add this as the second-last line.
If %num1% equ 1000 exit
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« 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

IP logged

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



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« 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?
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« 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 » IP logged

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



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« 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)
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« 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
IP logged

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



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« 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. 
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
smeezekitty
Newcomer



Thanked: 44
Posts: 0


« 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 
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
Pages: [1] 2 3  All - (Top) Print 
Home / Microsoft / Microsoft DOS / Create a folder « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.114 seconds with 20 queries.