AUTHOR

any super hoss geek smart computer studs online

why will this batch file run on my friends windows 7 and not on my XP os ?

@echo off
echo VLC Sleep Timer
echo.
:setup_timer
set /p m= Enter number of minutes [1 to 1440>:
set m=%m:,=%
if %m% leq 1440 if %m% gtr 0 goto run_timer
goto setup_timer
:run_timer
set /a s=m*60
timeout /T %s% /nobreak
taskkill /T /F /im vlc.exe

I get this error

enter Herc.
timeout is part of the XP resource kit
not included with the OS
if you dont want to install the reskit, or just snag a timeout.exe from another XP box, see if you can just use 'choice' as a half-assed workaround
Hercules quote:
timeout is part of the XP resource kit
not included with the OS
Smiley
can I get it somehows ?
hiyou39 quote:
Smiley
can I get it somehows ?
the copy from Server 2003 should do it, if you have one around

I haven't tried copying timeout.exe from a Win7 installation to an XP installation. It might work - do that, drop it into System32

I used to have a copy sitting around for just such an occasion (clients who didnt have the reskit installed, and didnt want to, id just link them @ timeout.exe on my server)

I highly highly doubt i still do, though
Hercules quote:
if you dont want to install the reskit, or just snag a timeout.exe from another XP box, see if you can just use 'choice' as a half-assed workaround
only people that have installed the resource kit will have the timeout.exe right ?
hiyou39 quote:
only people that have installed the resource kit will have the timeout.exe right ?
on XP? I believe that's the case, yes. Note I haven't touched a Windows OS in any depth for a good ~2 years, though.

But I do recall the XP reskit being a pain to get ahold of
actually, see if the 2003 Resource Kit will install on XP
Hercules quote:
on XP? I believe that's the case, yes. Note I haven't touched a Windows OS in any depth for a good ~2 years, though.

But I do recall the XP reskit being a pain to get ahold of
if I can get my hands on a timeout.exe
how do I install it ?
hiyou39 quote:
if I can get my hands on a timeout.exe
how do I install it ?
no install necessary, it's a standalone executable
you just need to dump timeout.exe somewhere in the system PATH - easiest is normally C:\Windows\System32

Hercules quote:
no install necessary, it's a standalone executable
you just need to dump timeout.exe somewhere in the system PATH - easiest is normally C:\Windows\System32


gotcha, thanks herc
that was driving me nuts Smiley
hiyou39 quote:
gotcha, thanks herc
that was driving me nuts Smiley
one thing to note, the syntax for timeout.exe is slightly different between versions

one of them required switches (7 obviously does), the other was simply


timeout 20


to do a 20 second timeout.
So if you get syntax errors from timeout, heads up, that's likely why
NB: since batch scripts are shit, vbscript obtuse as fuck, and XP otherwise devoid of a proper scripting environment, you should look into installing ActivePerl, and doing this sort of thing with a perl script. ActivePerl is free.

Hell I'd throw the perl script together FOR you if you had it installed.
thanks again
once again you have proven to be the boss hog up in hurrrr

Quick reply

Sign in to post a message.
Smileys

Times shown in Eastern Time (ET).