All you DOS gurus: got a tough one! - TechRepublic
General discussion
March 7, 2003 at 02:31 AM
cvn70_it2

All you DOS gurus: got a tough one!

by cvn70_it2 . Updated 23 years, 4 months ago

Okay, so I am the admin guy for a system that creates a log file after the nightly backups. I want to copy the file (which I know how to do) and name it to the current date. I am using the following commands:

FOR /F “tokens=1-4 delims=/ ” %i in (‘date /t’) do set filerename=%j%k%%l
and
RENAME file.log %filerename%.log
These run fine by themselves, but they don’t run in the batch file I created. Does anyone know why? It’s killin me! Thanks!

This discussion is locked

All Comments