Home / Microsoft / Microsoft DOS / Create a folder
0 Members and 2 Guests 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 :)
Helpmeh
Egghead



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #15 on: August 24, 2009, 08:55:11 PM »

i am still confused on what you are tring to do
hey HelpMeh do you understand this  i did this on 
Well then. If you can do that on  then what (in words) is this? 
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 #16 on: August 24, 2009, 08:58:49 PM »

singing?
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BatchFileBasics
Hopeful



Thanked: 18
Posts: 387


BatchFileBasics
« Reply #17 on: August 24, 2009, 09:00:07 PM »

what are you guys typing in!!  :o
IP logged

When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.
Helpmeh
Egghead



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #18 on: August 24, 2009, 09:02:30 PM »

singing?
I'm on my iPod Touch, smeeze is either on that or an iPhone. The boxes you see are little pictures for us.

But, are you TRULY on  and not on . Because I think not.
These posts are really off topic. I will no longer respond to these posts in this thread.
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 #19 on: August 24, 2009, 09:04:19 PM »

no more  and back to the topic
maybe it would help to know why you are making these folders
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #20 on: August 25, 2009, 09:38:04 AM »

i am still confused on what you are tring to do
hey HelpMeh do you understand this  i did this on 

I am here again to continue with the proofs.

I don't see your symbols .

What are they ?

 ::)
IP logged

No dejes que tu felicidad dependa de lo que no depende de tí.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #21 on: August 25, 2009, 09:45:56 AM »

Ooohh I see. Internal pictures for iphone users.....

 :P

Well

This is the next script according to your indications.

*******************************************************************
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
If %num1% equ 1000 exit
Goto loop
*****************************************************************

I think I have been misunderstood. In other words : I don't explain well the question to solve.

I repite entirely from the basis to assure , giving additional proposals to assure the solution.

I begin :

The solution to the problem consist in create a single one only folder. Only one folder. Just one.

This only one created new folder is in the form : 129.09

Where 129 is a sequential name from 000 to 999.
09 are the two last digits of the year you make the only one folder with the bat.

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 only one folder will be  : Y:\GAB\THEME\129.09

The Process for the bat is
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 (only one folder each execution of the bat file)

Can you help me please  ?
Thanksxx

*************************************

Well.

I am trying to inquiry your code. As you know I only am a computerhope friend, not a programmer, but I think you have proposed a loop from the first value to the last one. I suppose the proposed script will create one thousand folders at the same time. I only need one by time.

Thanksxxxx
IP logged

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



Thanked: 44
Posts: 0


« Reply #22 on: August 25, 2009, 10:47:49 AM »

Code: [Select]
for /L %%d in (0, 1, 999) do (
set _DATE = %date%
md %%d%%_DATE
)
i dont know if that will work
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #23 on: August 25, 2009, 11:54:30 AM »

no more  and back to the topic
maybe it would help to know why you are making these folders

For me are very important folders in my work .
Each folder is an expedient . I do industrial engineering projects.
Each project have a folder and several subfolders : ACOPI, AYUDA, BCDO, etc.
I try now to create the main folder.
My objective is to have a script for doing this in a automated way.

And I think is possible with the Computer Help Help


Edited : I mean Hope Help .....
IP logged

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



Thanked: 44
Posts: 0


« Reply #24 on: August 25, 2009, 11:57:24 AM »

Code: [Select]
for /L %%d in (0, 1, 999) do (
set _DATE = %date%
md %%d%%.DATE
)
[code]
[/code]
your last post seems to conflict with the one before that
maybe somone else will understand betterjuxtaposition.
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #25 on: August 25, 2009, 11:59:39 AM »

A script problem with the webbbbbb ??????????

 ::)
IP logged

No dejes que tu felicidad dependa de lo que no depende de tí.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #26 on: August 27, 2009, 04:18:25 PM »

What happens ?

Have I said something ?

I hope your help.

Thank a lot.
IP logged

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



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #27 on: August 28, 2009, 02:17:30 AM »


Have I said something ?
.


Don't worry.

Better to ignore Smeezekitty.
IP logged


Proud to be European
smeezekitty
Newcomer



Thanked: 44
Posts: 0


« Reply #28 on: August 28, 2009, 12:28:42 PM »

dont worry better to ignore Salmon Trout
also becareful make sure salmon doesnt think you are making a virus
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BatchFileBasics
Hopeful



Thanked: 18
Posts: 387


BatchFileBasics
« Reply #29 on: August 28, 2009, 12:41:05 PM »

last time i checked, we weren't in the off-topic board.

Esgrimidor, don't worry you will receive help.
but i am confused, what is it that you request help with?
IP logged

When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #30 on: August 28, 2009, 03:34:20 PM »

Don't worry. Sooner o Later I will have a folder created.

I have another question involving two languages (I think....). I begin another post......

See you later my friends. I hope your help.,
IP logged

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



Thanked: 44
Posts: 0


« Reply #31 on: August 28, 2009, 03:35:52 PM »

[Moderated Message: Removed Post.]
« Last Edit: August 28, 2009, 09:27:44 PM by Carbon Dudeoxide » IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BatchFileBasics
Hopeful



Thanked: 18
Posts: 387


BatchFileBasics
« Reply #32 on: August 28, 2009, 03:45:00 PM »

he has another question with two languages, so he will create a new post either here or \\computer programming

either hes thanking us....or he wants more help on his new posts
IP logged

When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.
Esgrimidor
Topic Starter
Intermediate



Thanked: 1
Posts: 205


« Reply #33 on: August 28, 2009, 03:55:01 PM »

Please. For me is difficult to explain in other language about a subject is not my own.

What part you don't understand and I try to explain it in detail.

Thankxxxx

IP logged

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



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #34 on: August 28, 2009, 03:57:18 PM »

Esgrimidor, the *censored* called Smeezekitty decided to give you a grammar lesson. Why, I do not know. He is not the greatest English scholar. Definitely not. Best to ignore him, like I said before.
IP logged


Proud to be European
BatchFileBasics
Hopeful



Thanked: 18
Posts: 387


BatchFileBasics
« Reply #35 on: August 28, 2009, 04:01:58 PM »

alright salmon, you are really getting on my nerves, i don't care the first time, but this is getting ridiculous, you are now doing more damage than help.

and Esgrimidor, what is your native language? i can use an internet translator to talk to you easier and help you to the best of my ability
IP logged

When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.
Salmon Trout
Sage



Thanked: 546
Posts: 7,952

Computer: Specs
Experience: Beginner
OS: Unknown

1
« Reply #36 on: August 28, 2009, 04:06:35 PM »

Esgrimidor, send me a PM and I will try to help you. I speak Spanish (a little) and French (better).

BatchfileBasics, go pound some sand.

IP logged


Proud to be European
smeezekitty
Newcomer



Thanked: 44
Posts: 0


« Reply #37 on: August 28, 2009, 05:15:14 PM »

[Moderated Message: Removed post.]
« Last Edit: August 28, 2009, 09:27:28 PM by Carbon Dudeoxide » IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BatchFileBasics
Hopeful



Thanked: 18
Posts: 387


BatchFileBasics
« Reply #38 on: August 28, 2009, 05:29:57 PM »

Esgrimidor, send me a PM and I will try to help you. I speak Spanish (a little) and French (better).

BatchfileBasics, go pound some sand.



exactly what i mean, more damage than good
IP logged

When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.
Helpmeh
Egghead



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #39 on: August 28, 2009, 07:31:05 PM »

Guys! Stop fighting. If you must, send each other pms, or have seperate rant threads in the off topic section. Don't hijack someone's thread to b!tch at each other.
IP logged

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



Thanked: 18
Posts: 387


BatchFileBasics
« Reply #40 on: August 28, 2009, 07:44:35 PM »

yea idk im not trying to be the problem, but while waiting for op's next posts...
IP logged

When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.
smeezekitty
Newcomer



Thanked: 44
Posts: 0


« Reply #41 on: August 28, 2009, 07:45:59 PM »

yea but fish head told the orig poster to go PM him
instead of posting on the topic
IP logged

Acer extensa 463oz
2 gb ram
160gb hdd
2ghz processor
and desk fan sitting next to it for cooling :)
BatchFileBasics
Hopeful



Thanked: 18
Posts: 387


BatchFileBasics
« Reply #42 on: August 28, 2009, 07:47:43 PM »

smeeze, why you gotta instigate? if you don't say anything about him, there wont be fighting.
but your right(not about the fish head)
IP logged

When the power of love overcomes the love of power the world will know peace - Jimi Hendrix.
Helpmeh
Egghead



Thanked: 117
Posts: 3,608

Experience: Experienced
OS: Windows XP


Roar.

1
« Reply #43 on: August 28, 2009, 08:01:23 PM »

Guys...

Smeeze, you are not the whole problem, but you are part of it. Every time you are about to click that post button, ask yourself this: "is this post helpful?"

Salmon, you are also not the whole problem, but you have a harder solution. Stop letting people push your buttons. Ignore people who are annoying you.
IP logged

Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.
Carbon Dudeoxide
Global Moderator
Mastermind


Thanked: 146
Posts: 16,087

Certifications: List
Computer: Specs
Experience: Expert
OS: Mac OS


Carbon - The building block of life on Earth.

My Youtube Profile 1 1
« Reply #44 on: August 28, 2009, 09:29:06 PM »

I believe this post has run its toll.

Closed.
IP logged

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.193 seconds with 19 queries.