Sign in to follow this  
Followers 0
Puckmeister

SystemIdleTime

3 posts in this topic

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 ?

Share this post


Link to post
Share on other sites



Hello,

I think that you can use pslist from the pstools : http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

in a cmd, type: pslist idle

it 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


Share this post


Link to post
Share on other sites

thx for this solution, i tried it with pslist too yesterday.

i think its the only way to do it (for now) :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0