Run a command on wake from standby - AVS Forum | Home Theater Discussions And Reviews
Forum Jump: 
 
Thread Tools
post #1 of 15 Old 03-04-2008, 08:23 AM - Thread Starter
Member
 
scottdw's Avatar
 
Join Date: Nov 2002
Location: Maryland
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
I have a slight problem with my HTPC. If I wake it from standy using the mouse all is fine but if I try to wake it using a "magic packet" from another computer, it wakes up but the monitor/screen does not turn on until I move the mouse. I came up with the idea of using Girder to simulate a mouse move and need to run this on resume from standby.
I read this thread which discusses using eventtriggers to do this. I looked at my event log and and found an entry for "bcm4sbxp" which basically says the network connection is up. If I view this in the Event Viewer I see it is set to "Event ID: 9". So I setup a test batch file just to see if the eventtriggers works (just opens notepad), I tested the batch by itself to make sure it works and it does then I issue this command:
eventtriggers /create /tr "TestTrigger" /l system /eid 9 /tk c:\\windows\\system32\ est.bat /ru myusername /rp password
and it said it has been created.
I put my computer in standby and then bring it out and get nothing. I tried it with an eid of 1003 which was a warning I was getting and it worked fine. I even tried it without the /l switch and get nothing.

Can someone help me with the eventtriggers command or maybe tell me another way to accomplish this.

Thanks,
Scott

Scott
scottdw is offline  
Sponsored Links
Advertisement
 
post #2 of 15 Old 03-04-2008, 10:18 AM
Member
 
big poppa pump's Avatar
 
Join Date: Dec 2006
Location: San Antonio, TX
Posts: 39
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Code:
Option Explicit

Dim wmiPowerManagementEvent, oShell
Const cntEventEnteringWakeup = 7

Set wmiPowerManagementEvent = GetObject("winmgmts:").ExecNotificationQuery("Select * from Win32_PowerManagementEvent")
Do
   If wmiPowerManagementEvent.NextEvent.EventType = cntEventEnteringWakeup Then
 set oShell=createobject("WScript.Shell")
 oShell.Run "%SystemRoot%\\ehome\\ehshell.exe"
   End If
Loop
copy and paste the above code into notepad and save it as a .vbs file. Change the bold letters to point it to whatever file you want to run.

Place the .vbs file in the Startup folder for all users. Logoff and then Login back again. Your file will now run every time you wake up your HTPC.

Good luck!
big poppa pump is offline  
post #3 of 15 Old 03-04-2008, 11:18 AM - Thread Starter
Member
 
scottdw's Avatar
 
Join Date: Nov 2002
Location: Maryland
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Thanks that did work as far as running the .bat after wake from standby but the girder trick did not "wake the monitor" up. As soon as I physically shake the mouse the screen comes up and the .bat starts. So the trick you gave me will only work after I can see the screen.

Any other ideas on what I can try???

Scott
scottdw is offline  
Sponsored Links
Advertisement
 
post #4 of 15 Old 03-04-2008, 12:01 PM
Advanced Member
 
lstepnio's Avatar
 
Join Date: Jan 2003
Location: Tampa, Florida USA
Posts: 592
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
disabled screen blanking in windows?
lstepnio is offline  
post #5 of 15 Old 03-04-2008, 12:06 PM - Thread Starter
Member
 
scottdw's Avatar
 
Join Date: Nov 2002
Location: Maryland
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
I don't have any of that turned on. You mean the 'Turn off Monitor" section in the Power Options Properties, right??

Scott
scottdw is offline  
post #6 of 15 Old 03-28-2008, 11:19 AM
Member
 
daemonic's Avatar
 
Join Date: Jan 2005
Location: Rancho Cordova, CA
Posts: 136
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
I've had this same issue for years. I had my HTPC in the livingroom and sometimes I want to do some things on it but someone is watching TV. So I use VNC into the HTPC, but if it was in standby, it wakes but the display does not (stays in D3 state). The VNC mirror driver needs that display controller, so you effectively can't see anything or inject any mouse/keystrokes virtually to wake it up. I *used* to just hit a button on the media center remote, but not that PC was cycled into the den, and replaced with a Vista Media Center in the livingroom (which by the way, *does* fully wake from suspend and capable of VNC).

So now that its in the other room, the problem is really annoying because I have to get up from the couch, go upstairs, move the mouse, walk back downstairs, and finally open my VNC on my laptop to do some background stuff while watching TV.

Anyway, I've been looking for a way to invoke a resume script to wake the display. I figured if I could just wake the display, or perhaps invoke a fake mouse clock, it might work. Any update on this thread? I'll subscribe just incase, and if I figure it out I'll be sure to post here.

-T
daemonic is offline  
post #7 of 15 Old 03-28-2008, 11:35 AM - Thread Starter
Member
 
scottdw's Avatar
 
Join Date: Nov 2002
Location: Maryland
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by daemonic View Post


Anyway, I've been looking for a way to invoke a resume script to wake the display. I figured if I could just wake the display, or perhaps invoke a fake mouse clock, it might work. Any update on this thread? I'll subscribe just incase, and if I figure it out I'll be sure to post here.

No, from what I can tell the script will not run until after the mouse has been moved to wake up the display...thats effective

Let me know if you find out anything.

Scott
scottdw is offline  
post #8 of 15 Old 03-28-2008, 12:11 PM
Member
 
daemonic's Avatar
 
Join Date: Jan 2005
Location: Rancho Cordova, CA
Posts: 136
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by scottdw View Post

No, from what I can tell the script will not run until after the mouse has been moved to wake up the display...thats effective

Let me know if you find out anything.

Are you referring to the technique mentioned early in this thread? It sounded so promising as a first step, and then I just needed a "magic" command to wake the GUI.

I'll ask our display driver team guys here at work to see if they know a general method to initiate a D3->D0 transition. I don't know if the problem is specific to ATI+XP or not, because my Vista+Nvidia combo wakes the display fine and can be controlled via VNC from a WOL....

I just refuse to believe this is impossible!!

I can't experiment on my home PC while at work, but I can at least start combing the register for any flags ATI uses for the device state since my laptop has a similar ATI display controller. There *has* to be something. I thought there was a "set power state" register on PCI device 2 that may be standard, and would give me a brute force method...

-T
daemonic is offline  
post #9 of 15 Old 03-28-2008, 12:15 PM
AVS Forum Special Member
 
umdivx's Avatar
 
Join Date: Nov 2004
Location: Minnesota (aka the frozen tundra)
Posts: 5,322
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 12
I know in my Asus bios there is a setting for reset/or redisplay video after sleep. Maybe this is an option that would fix your issues?

- Josh
umdivx is offline  
post #10 of 15 Old 03-28-2008, 12:21 PM
Member
 
daemonic's Avatar
 
Join Date: Jan 2005
Location: Rancho Cordova, CA
Posts: 136
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by umdivx View Post

I know in my Asus bios there is a setting for reset/or redisplay video after sleep. Maybe this is an option that would fix your issues?

- Josh

Boy, would that rule if it were that easy. I actually haven't looked in BIOS because it is an OEM (Dell) and they really strip options down the lowest comment user/denominator. I'll have to check when I get home, but I'm setting my expectations low...

-T
daemonic is offline  
post #11 of 15 Old 03-28-2008, 12:27 PM - Thread Starter
Member
 
scottdw's Avatar
 
Join Date: Nov 2002
Location: Maryland
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Quote:
Originally Posted by daemonic View Post

Are you referring to the technique mentioned early in this thread? It sounded so promising as a first step, and then I just needed a "magic" command to wake the GUI.

I'll ask our display driver team guys here at work to see if they know a general method to initiate a D3->D0 transition. I don't know if the problem is specific to ATI+XP or not, because my Vista+Nvidia combo wakes the display fine and can be controlled via VNC from a WOL....

I just refuse to believe this is impossible!!

I can't experiment on my home PC while at work, but I can at least start combing the register for any flags ATI uses for the device state since my laptop has a similar ATI display controller. There *has* to be something. I thought there was a "set power state" register on PCI device 2 that may be standard, and would give me a brute force method...

yeah that is what I already tried. I have a Dell with an Nvidia card...same thing happens on my Dell laptop, not sure what card. I basically did a "magic packet" wakeup and had the script set like above and my computer would wake up but no display. As soon as I hit a key or shook the mouse the script above would run but not before I "woke up" the monitor.

Scott
scottdw is offline  
post #12 of 15 Old 03-28-2008, 02:38 PM
Member
 
daemonic's Avatar
 
Join Date: Jan 2005
Location: Rancho Cordova, CA
Posts: 136
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Well, I checked with one of our display experts, and he says that the display *shoud* wake up with the rest of the system. He says we've issued BIOS workarounds in the past to get past issues like this for legacy ATI cards, most recently with the i945 chipset. But that won't help me any since this is not one of our lab systems I can just play with.

By the way, I never tried remote desktop on this machine. Anyone know if that has similar limiations on starting if the display is not up? How about a remote console window?

-T
daemonic is offline  
post #13 of 15 Old 03-29-2008, 05:08 PM - Thread Starter
Member
 
scottdw's Avatar
 
Join Date: Nov 2002
Location: Maryland
Posts: 119
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
I have tried remote desktop and you get the login box and as soon as you login it closes, I am pretty sure that is what happens. Hopefully between all of us we can figure this out. I am getting tired of having to keep getting up and tapping a key on the keyboard whenever I want to remote into it

Scott
scottdw is offline  
post #14 of 15 Old 03-29-2008, 10:14 PM
Member
 
daemonic's Avatar
 
Join Date: Jan 2005
Location: Rancho Cordova, CA
Posts: 136
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 0 Post(s)
Liked: 10
Well, I've still got no software solution for this. I did try a hardware workaround though.

My Dell PC where the display won't wake up is an XP media center that came with an IR remote. For years, if the display had turned off, I could just click some buttons on the IR remote and then VNC in. Well, IR is line of sight, but RF goes through walls. Since I do happen to have an RF media center remote/mouse, I put it on the Dell just to see if it can wake it. Turns out it is in RF range from my livingroom to the den, and it worked. Of course, you have to have the RF remote with you where you want to VNC from, and it only works for people trying to save themselves 30 ft of walking.

So, definitely not a robust solution...

-T
daemonic is offline  
post #15 of 15 Old 11-16-2010, 12:45 PM
Senior Member
 
jmsnyc's Avatar
 
Join Date: Sep 2006
Posts: 421
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Quoted: 31 Post(s)
Liked: 13
Quote:
Originally Posted by big poppa pump View Post

Code:
Option Explicit

Dim wmiPowerManagementEvent, oShell
Const cntEventEnteringWakeup = 7

Set wmiPowerManagementEvent = GetObject("winmgmts:").ExecNotificationQuery("Select * from Win32_PowerManagementEvent")
Do
   If wmiPowerManagementEvent.NextEvent.EventType = cntEventEnteringWakeup Then
 set oShell=createobject("WScript.Shell")
 oShell.Run "%SystemRoot%\\ehome\\ehshell.exe"
   End If
Loop
copy and paste the above code into notepad and save it as a .vbs file. Change the bold letters to point it to whatever file you want to run.

Place the .vbs file in the Startup folder for all users. Logoff and then Login back again. Your file will now run every time you wake up your HTPC.

Good luck!


Have people use this succesfully?
jmsnyc is offline  
Sponsored Links
Advertisement
 
Reply Home Theater Computers

Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page


Forum Jump: 

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off