date format and BAT execution

  • Thread starter Thread starter rarewolf
  • Start date Start date
R

rarewolf

I have a short BAT file that is intended to be scheduled for xcopying
files from one location to another. It is also supposed to create a
logfiles, the filename of which includes the date. For example:

date /t >C:\batch-jobs\MyEmail_%date:/=-%.txt
time /t >>C:\batch-jobs\MyEmail_%date:/=-%.txt

The 1st line creates the logfile and writes the date into it, and the
2nd writes the begin time.

If I simply run this BAT file, the filename is
"MyEmail_04-10-2007.txt", and the date inside the file is
"04-10-2007". However, if I schedule the BAT file and the scheduler
runs it, the filename is "MyEmail_Thu", and the date inside the file
is "Thu 10/04/2007".

Weird! ... anyone got a clue?

TIA & cheerios from the Avalon Peninsula Newfoundland :o)
 
...

If I simply run this BAT file, the filename is
"MyEmail_04-10-2007.txt", and the date inside the file is
"04-10-2007". However, if I schedule the BAT file and the scheduler
runs it, the filename is "MyEmail_Thu", and the date inside the file
is "Thu 10/04/2007".

Weird! ... anyone got a clue?

It didn't take me long to figure out that the logon under which the
BAT is scheduled (adminstrator) has its date format set differently
than the logon under which the BAT is simply run.

cheerios :o)
 
Back
Top