Dos Question!

Melendez

At the Start
Joined
May 2, 2003
Messages
3,035
Location
Dublin
I'm sure there are millions of MS_DOS forums out there, but we seem to have plenty of techies on here.

How do you append the current date on to a file name in dos (without knowing the current date)

eg I want \path\example.txt to appear as \path\example.020305 (or any date format)
 
Which version of Windows do you have ?

Reason I ask is that Windows XP does not include DOS. The Command Prompt in WinXP is just the WinNT/2K/XP system console, which is not DOS
 
Windows XP it is. Any way to do it with that?

The closest I've come is ...

cmd(D:\pathname\Test.bat test.DAT [%DATE:~0,2%%Date:~3,2%%DATE:~6,4%])

where test.bat has ...

move %1 backup\%1%2

... which works fine when done from the command line, but the software I'm using translates the command you use before sending it for exection and doesn't seem to be able to interpret this.
 
Is this any better ?

cmd(D:\pathname\Test.bat test.DAT [%Date:~-4,4%%Date:~-10,2%%Date:~-7,2%])


with _%Time:~0,2%%Time:~3,2%.mer if you want the time as well ?


What software are you using ?
 
homer.jpg


Sorry, misread it - thought you said a DOH! question...
 
Back
Top