Jump to content

SystemIdleTime


Recommended Posts

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 ?

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...