Computing.Net > Forums > Programming > Batch for creating new folder

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch for creating new folder

Reply to Message Icon

Name: Mariano
Date: February 4, 2003 at 12:02:48 Pacific
OS: WIN XP
CPU/Ram: P2/310
Comment:

I'd like to know a command to create a directory (folder) with the date inserted. For example "backup 02-04-2003".

Do you, wise guys, know how to write this in batch command?

If I'm asking sth impossible, at least tell me how to create a folder with different name each time a execute the BAT file.

Thank you very much !!!!!!!!
Mariano



Sponsored Link
Ads by Google

Response Number 1
Name: borelli34
Date: February 5, 2003 at 20:17:21 Pacific
Reply:

========================================================================================
The thing is that the command prompt is not a programmable environment like UNIX/Linix shells. Batch files are almost entirely written to control the flow of action at the command prompt but is not very well suited to controling the data/information itself. If you really need to do this then a program would be the quickest and easiest way to proceed. If you need someone to make a small program for you (DOS or Windows) then email me and I can throw something together that will create a folder with the days date if it does not already exist.
========================================================================================

borelli34@cox.net
John Borelli


0

Response Number 2
Name: cipsy
Date: February 6, 2003 at 21:39:52 Pacific
Reply:

I had the same problem once.
The solution is:

@echo off


rem it creates the directory by day
for /f "tokens=1,2,3* delims=/" %%r in ('echo %date%') do (
echo 1=%%r 2=%%s 3=%%t
echo.
set day=%%s
)

set name=tran%zi%
mkdir c:\"%nume%"



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Drawing Triangles in VB6?... dtech10 Reply from 1/31



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch for creating new folder

Batch to create an incremented fold www.computing.net/answers/programming/batch-to-create-an-incremented-fold/16805.html

Create new dir based on dir names www.computing.net/answers/programming/create-new-dir-based-on-dir-names/19742.html

create a new folder www.computing.net/answers/programming/create-a-new-folder/18281.html