Puckmeister Posted April 11, 2005 Posted April 11, 2005 Hi, i searched the whole forum but i can`t find anything about it. Is it possible to retrieve the SystemIdleTime ? I want to start some tasks when the system has been idle for some time, perhaps like the harddisk suspend does. I need the exact count of it. Anyone a suggestion ?
sylvanie Posted April 11, 2005 Posted April 11, 2005 Hello, I think that you can use pslist from the pstools : http://www.sysinternals.com/ntw2k/freeware/pstools.shtmlin a cmd, type: pslist idleit will return information about idle with CPU time.If it's what you are looking for, use this script to extract this information :$cmd='pslist.exe idle > '&@WorkingDir&'\logpslist.txt' RunWait(@ComSpec&' /c '&$cmd,@WorkingDir,@SW_HIDE) $fic=FileOpen(@WorkingDir&'\logpslist.txt',0) if $fic=-1 then Exit $line=FileReadLine($fic,9); the information is at the line number 9 FileClose($fic) $idletime=StringMid($line,49,11); the position of the time in the line MsgBox(0,"test",$idletime)I hope, it will help you
Puckmeister Posted April 12, 2005 Author Posted April 12, 2005 thx for this solution, i tried it with pslist too yesterday. i think its the only way to do it (for now)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now