change date format when using command prompt batch

  • Thread starter Thread starter bobm@sbc
  • Start date Start date
B

bobm@sbc

I am running a bat file that uses Winzip. The bat file
starts up a "command prompt" based on a time and zips all
the txt files within a directory.
The problem I am having is that becuase the workstation
runs WIN2K, the format of the date is ddd-mm-dd-yyyy.
Even when I configure the long date and or short date the
date that is displayed and subsequently inserted into the
zip name is ddd-mm-dd-yyy which is truncated to ddd.zip
What I am trying to do is end up with a zip name = mm-dd-yy
instead I get ex.fri.zip, then I have to manually rename
it.
Is there a way to configure the "DOS" date???

Bob M.
 
THANKS
-----Original Message-----


Within your batch file, use the substring notation to extract the part of
the date you want. Something like %date:~4,8% should do what you want.
Type "set /?" at a command prompt (cmd.exe, not command.com) for more
information.
 
Back
Top