Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
Does someone know how to get seconds from DOS?
I'm running on NT 4.0 and using "Time /T"" command gives me the syntax: hh:mm in english format. Therefor i try with "time" command which gives me the exact syntax (ie. french format HH:MM:SS) but it seems not easy to extract what i need ...
Thanks for your help.

That's exact.
I'd like to get this value into a batch file which create specific files with timestamp like: $FILE_HHMMSS.

Each file must be created with an extension different.
In fact, i try to develop a procedure which should be used throught a telnet session on NT server by different users. This procedure or batch file use user input written in qbasic and each call of these user input is done while launching:
qbasic /run $FILE_HHMM...

The following script was written on Win98, and will get the seconds decimals (00-99) to the %RANDOM% variable. I don't know if it works on NT:
@echo off
echo @PROMPT SET RANDOM=$T$_> %temp%.\$$tmp.bat
%comspec% /c %temp%.\$$tmp.bat > %temp%.\$$tmp2.bat
rem > %temp%.\$$tmp.bat
for %%s in (e10D'0' e10F''3B e112''3B e115''3B w q) do echo %%s>> %temp%.\$$tmp.bat
debug.exe %temp%.\$$tmp2.bat < %temp%.\$$tmp.bat > nul
call %temp%.\$$tmp2.bat
echo SET RANDOM=%%4> %temp%.\$$tmp.bat
::echo SET RANDOM=%%3> %temp%.\$$tmp.bat
call %temp%.\$$tmp.bat;%random%
for %%d in (tmp.bat tmp2.bat) do if exist %temp%.\$$%%d del %temp%.\$$%%dWATCH OUT FOR LINE WRAPPING! Cut-paste this into a text file and it will be alright.
If you really want the SECONDS, not the decimals, uncomment the commented line (get out the "::" on its begin)
I hope it works on NT.
-- Secret_Doom - Leonardo Pignataro --
secret_doom@hotmail.com
www.batch.hpg.com.br

![]() |
![]() |
![]() |

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