English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to be able to use the time command without it saying "Enter new time" afterwards so that I can place the time into a log (like time >> c:\timelog.log for example). How can I do this? I want to do the same thing with the date command as well.

Slightly unrelated, but I also forgot how to echo a blank line, could you tell me how to do that as well?

2006-08-16 09:18:22 · 5 answers · asked by Rich 5 in Computers & Internet Programming & Design

No you don't understand - if you type "time" at a prompt, it gives you the time and the says "Enter New Time" - I don't want it to say that because I want to save it to a text file.

2006-08-16 09:27:35 · update #1

No Jono, just typing echo does not leave a blank line, it tells you if echo is on or off.

Thanks for the /t thing, works great.

2006-08-17 07:13:19 · update #2

5 answers

Using Barrytabrah's suggestion, I have just run a batch file with the following lines

echo. | time/t >> c:\timelog.log
echo. | date/t >> c:\timelog.log

This created the log file, and added these lines to the file

22:07
16/08/2006

2006-08-16 10:25:20 · answer #1 · answered by freehandorb 2 · 1 0

Your best option is to use a pipe or |

On a UK keyboard the key is located to the left of the Z key on the same key as the backslash.

The full command would be;

echo. | time >> timelog.log

The 'echo.' sends a return character to the piped command, in this case 'time'.

The text file will still say;

The current time is: 21:31:30.47
Enter the new time:

but the command will complete without requiring an input. The 'time' command will never just display the time. If you want that you will have to find a small program that can do that for you. Can't find one right now. Feel free to email me and I might be able to write one for you. :)

2006-08-16 09:35:50 · answer #2 · answered by barrytabrah 3 · 0 0

actually enter "time /t"
for date "date /t"
this will just bring up the time and date without prompting you to enter a new time or date

2006-08-16 09:31:11 · answer #3 · answered by . 3 · 2 0

At the c: prompt....just type
time
this should give you the time of your system

2006-08-16 09:25:13 · answer #4 · answered by coachls 4 · 0 1

time > c:\time.log

ECHO blanks a line

2006-08-16 09:37:03 · answer #5 · answered by jono 2 · 0 0

fedest.com, questions and answers