Hello. I have been struggling on trying to figure out how to mimic Windows' TIMEOUT.EXE command. It's basically pause, but with a timer. You can either wait the specified number of seconds, or press any key to just continue on.
The reason I need this is because I'm trying to get this to work in Windows XP, which doesn't have the TIMEOUT command. Even when copying %windir%\system32\TIMEOUT.EXE to an XP computer, it complains about the exe not being a vaild Win32 executable.
Any help is appreciated.
Mimic Windows' TIMEOUT.EXE command
-
- Posts: 4
- Joined: 12 Nov 2017, 14:45
Re: Mimic Windows' TIMEOUT.EXE command
Just for the records ...
https://ss64.com/nt/timeout.html
I'd guess using a SetTimer-routine that ends itself once a key/button has been pressed should do the trick, right?
https://ss64.com/nt/timeout.html
I'd guess using a SetTimer-routine that ends itself once a key/button has been pressed should do the trick, right?
-
- Posts: 4
- Joined: 12 Nov 2017, 14:45
Re: Mimic Windows' TIMEOUT.EXE command
im sorry, im a complete n00b at this, could you help me please?
-
- Posts: 4
- Joined: 12 Nov 2017, 14:45
Re: Mimic Windows' TIMEOUT.EXE command
bump
im not asking for someone to write the script for me, i just need some assistance. im only used to writing batch scripts, ahk is a new animal for me.
thanks
im not asking for someone to write the script for me, i just need some assistance. im only used to writing batch scripts, ahk is a new animal for me.
thanks
Re: Mimic Windows' TIMEOUT.EXE command
its possible to have timeout.exe (from win 7) run on xp, but it shows no output. maybe use ping, example https://stackoverflow.com/questions/735 ... tch-script
Re: Mimic Windows' TIMEOUT.EXE command
Here is some basic code for timeout , you can always compile ahk code to exe .
To run this code as ahk file where 1220 is the sleeptime in ms, any key pressed will exit the program :
timeout code:
To run this code as ahk file where 1220 is the sleeptime in ms, any key pressed will exit the program :
Code: Select all
run, timeout.ahk 1220
Code: Select all
Loop, %0% ; For each parameter:
{
param := %A_Index%
break
}
Loop, 5000 ; any key will exit program
{
Hotkey, % "~*" GetKeyName(Format("vk{:x}", a_index - 1)), key_d
Hotkey, % "~*" GetKeyName(Format("sc{:x}", a_index - 1)), key_d
}
t:=a_tickcount ; for testing
sleep % param
msgbox % " slept " a_tickcount-t "ms" ; for testing
exitapp
key_d:
soundbeep
exitapp
-
- Posts: 4
- Joined: 12 Nov 2017, 14:45
Re: Mimic Windows' TIMEOUT.EXE command
hey thanks noname! that script works pretty well!
~nyan~
~nyan~
Who is online
Users browsing this forum: Descolada, roeleboele, Rohwedder, ulysim and 389 guests