Computing.Net > Forums > Programming > Batch file - export current time

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file - export current time

Reply to Message Icon

Name: minos
Date: May 31, 2008 at 08:43:57 Pacific
OS: XP Blackmoon
CPU/Ram: 8g
Product: AMD Custom
Comment:

I have created a batch file that administrates and monitors a network. I have reached around 2500+ lines of script. But now i am going over the program making afew adjustments.

When the user input his/her name it is exported to session.txt, i would like to export the time with the name to. i will show you a fragment of my current script.

-----

:loginuserpass1
set /p c=Enter your full name:
echo %C% >> Session.txt
echo time /t >> Session.txt
if "%C%"=="quit" goto quit
goto banner2

-----------------------

I attempted to export the time by inserting
echo time /t >> Session.txt
but this just add the words "time /t" to the file. I would like some help with the matter if at all possible. Thank you.

( \/ )( )( \( )/ \ / __)
) ( )( ) (( () )\__ \
(_/\/\_)(__)(_)\_)\__/ (___/



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: May 31, 2008 at 09:56:18 Pacific
Reply:

echo %TIME% >> Session.txt

EDIT:
You also have use of

echo %DATE% >> Session.txt


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file - export current time

Batch File-12 hours time format www.computing.net/answers/programming/batch-file12-hours-time-format/16748.html

Batch File runs multiple times www.computing.net/answers/programming/batch-file-runs-multiple-times/16932.html

Batch File - date and time on files www.computing.net/answers/programming/batch-file-date-and-time-on-files/9137.html