Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming a file by today's date

Status
Not open for further replies.

Arisap

IS-IT--Management
Jun 7, 2000
170
US
Anybody know how to name a file with today's date.txt i.e. 103000.txt?

Thanks In Advance,

Ari
 
The following batch file will create a folder based on the current date. You can modify it appropriately.

[tt]
@Echo off
setlocal
for /f "tokens=2 delims=/ " %%i in ('date /t') do set MONTH=%%i
for /f "tokens=3 delims=/ " %%i in ('date /t') do set DAY=%%i
for /f "tokens=4 delims=/ " %%i in ('date /t') do set YEAR=%%i

set FOLDER=%YEAR%-%MONTH%-%DAY%
md %FOLDER%
endlocal
[/tt]

Jeff
masterracker@hotmail.com

If everything seems to be going well: you don't have enough information.......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top