Page 1 of 1 1
Topic Options
#210426 - 2015-07-29 09:32 AM How to detect windows standby/sleep mode
Patrick20 Offline
Fresh Scripter

Registered: 2009-08-27
Posts: 22
Loc: Belgium
Hello,
is there a way to detect when someone put the machine in sleep mode , so the application can detect this?

Many thanks

Top
#210432 - 2015-07-29 10:02 PM Re: How to detect windows standby/sleep mode [Re: Patrick20]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
ping \:\)
Top
#210436 - 2015-07-30 02:33 AM Re: How to detect windows standby/sleep mode [Re: Arend_]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Took me a while... Yes, ping could work. Windows has shutdown events as well...
_________________________
!

download KiXnet

Top
#210439 - 2015-07-30 12:06 PM Re: How to detect windows standby/sleep mode [Re: Lonkero]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
What are you trying to accomplish and from where are you monitoring it?
If you mean from the workstation in question, you would have to run an application that monitors the power state and send a notification when it sees the appropriate change. Take a look at these, they might help:
Detect Windows Going in to Hibernate/Sleep
MSDN Power Broadcast

Ping only gives you a positive. A negative doesn't necessarily mean the workstation is down. The ping could be failing somewhere in between the originating and end-point workstations.

If it is important, I would have an application on each server you want to watch that monitors the power state and periodically report its status to a central reporting server. I think that is about the only reliable method.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.055 seconds in which 0.027 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org