Computing.Net > Forums > Disk Operating System > naming files with current date

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.

naming files with current date

Reply to Message Icon

Name: dave
Date: August 30, 2001 at 15:29:13 Pacific
Comment:

HI, I am trying to write a batch file that will name a file with the current date, preferably the day. I am running win2K.

Thanks,
David.



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: August 30, 2001 at 15:40:38 Pacific
Reply:

Now THAT's a batch FAQ =D

Use this to get the actual date to the variable %date%. I leave the rest to you.

@echo off
echo. |date |find "Current"> $$out.bat
echo SET DATE=%%4> current.bat
call $$out.bat
del $$out.bat
del current.bat


if that doesn't work, try this:


@echo off
rem > $^getd^$.tmp
echo set dircmd=%dircmd%> $$resdir.bat
dir |find /i "$^getd^$"> $$out.bat
echo set date=%%3> $^getd^$.bat
call $$out.bat
call $$resdir.bat
del $$out.bat
del $$resdir.bat
del $^getd^$.tmp
del $^getd^$.bat


That's it.

-- Secret_Doom --

secret_doom@hotmail.com
secretdoom.hpg.com.br


0
Reply to Message Icon

Related Posts

See More


Dos 6.0 Restore Utility windows95



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: naming files with current date

create file with current datetime www.computing.net/answers/dos/create-file-with-current-datetime/13074.html

Rename file with current date www.computing.net/answers/dos/rename-file-with-current-date/13069.html

Naming directory with current date www.computing.net/answers/dos/naming-directory-with-current-date/14156.html