Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

========================================================================================
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

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%"

![]() |
Drawing Triangles in VB6?...
|
dtech10 Reply from 1/31
|

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