I want a batch file that will automatically create a list of all files
created "today", every day.
If it was just a matter of writing this to run today, I'd use:
dir c:\ /s | find 07/09/04 > filestoday.txt
but I want to put this in my shutdown menu so that it will happen
automatically as I am walking to the parking lot.
I believe that "set today=%date%" will create a variable containing
today's date, but I don't know how to make this value the argument of
the "find" command.
Any help would be appreciated.
dir c:\ /s | find "%DATE:~4%" > filestoday.txt
See (http://TheSystemGuard.com/MtCmds/GetValue/GetLogDate.htm).
The variable %#LogDate% will CONSISTENTLY be yyyymmdd.
In your specific case:
CALL ntlib.cmd /Quiet /Init
DIR C:\ /s | %.Find% %#LogDate:~4,2%/%#LogDate:~6,2%/%#LogDate:~2,2%
*******
%.Find% is the ExactName Mount/\Command for Find.exe. It provides
additional reliability by specifying EXACTLY what command you want to run.
See (http://TheSystemGuard.com/MtCmds/ExactName)
All of the above are FREE with the Advanced Command Library.
(http://ntlib.com)
*******
-tsg
/-----------------+---------------+----------------------\
| COMPATIBILITY | CLARITY | SPEED |
| Write code ONCE | Make it clear | THEN...Make it fast! |
\-----------------+---------------+----------------------/
400+ command-line resources using ONLY native NT commands!
(http://TheSystemGuard.com/default.asp#MasterCommandList)