Computing.Net > Forums > Disk Operating System > Timestamp for .bat

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Timestamp for .bat

Reply to Message Icon

Name: ttocs
Date: April 8, 2003 at 16:43:26 Pacific
OS: Windows 2000
CPU/Ram: p4 1.6 / 512
Comment:

I am looking to attach a timestamp to the following command
net view >> \\superbeast\c$\NETSTATUS.txt

How can I add the time and date to the .txt file?
Thank you




Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: April 9, 2003 at 01:38:36 Pacific
Reply:

Use the following batch script:

@Echo Off

For /F "delims=" %%I in ('Date /T') Do Set MyDate=%%I
For /F "delims=" %%I in ('Time /T') Do Set MyTime=%%I

Echo Net view issued at %MyTime% on %MyDate% >> \\superbeast\c$\NETSTATUS.txt

Net view >> \\superbeast\c$\NETSTATUS.txt

Once you set the MyDate and MyTime environmental variables, you can modify the proposed script as you like.
I hope this helps.


0

Response Number 2
Name: ttocs
Date: April 10, 2003 at 01:28:43 Pacific
Reply:

Thank you.....that worked out nicely.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


networking DOS program passing variables into a ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Timestamp for .bat

ideas for .bat files www.computing.net/answers/dos/ideas-for-bat-files/13151.html

Append to a Line in a .bat file www.computing.net/answers/dos/append-to-a-line-in-a-bat-file/984.html

BAT to COM / EXE www.computing.net/answers/dos/bat-to-com-exe/7111.html