date format and BAT execution

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 :blush:)
 
R

rarewolf

...

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 :blush:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top