Help with DOS batch scripting


Must be dreaming...
Just wondering if the following is possible:

If I were to put this into a batch file, for example:
@echo off
echo Copy done @
date /t
time /t
The following would be displayed onscreen correct?
Copy done @
Mon 01/01/0001
00:01 AM

Now what I want to do is to get the above info displayed onscreen like this instead:
Copy done @ Mon 01/01/0001 00:01 AM
I want it on the one same line instead of the three lines? Is it possible? Thanks and any input is appreciated. :D


Are we there yet?
This should do what you need to do:

set timestamp=%date% %time%
echo Copy done @ %timestamp%

Sample output:

Copy done @ Sun 01/18/2004 22:33:16.29


Must be dreaming...
Just what I needed. Thank you very much.
I'm interested in learning more of such programming, do you know where I can do that?

Umm, got a problem. Are the %date% and %time% commands OS specific? Because I tested the commands on my WinXP system at home, and they worked fine, but I tried them on a WinNT system, and it doesn't show the date and time. :(


Are we there yet?
I think that those commands will only work on Windows 2000 and above. I haven't used an NT machine in a couple of years so I have dumped most of what I remember about it.

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member