home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
HTPC Projects
HTPC Projects
Remote is dead after stand by/hibernate
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="skoov" data-source="post: 109065" data-attributes="member: 24844"><p><strong>Here's the script then</strong></p><p></p><p>Save this into a file with '.vbs' extension and then run. You can create a shortcut in your 'start up' folder to run each time windows runs.</p><p></p><p>Enter any commands you want to run when the computer is suspending/hibernating in the 'case 4' section. The command taskkill is available as standard in XP Pro, but not in XP Home. </p><p></p><p>Any commands when resuming go into the 'case 7' and 'case 18' sections. Depending on how the system is 'told to resume' depends which of these two cases occur, see <a href="http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_ksrm.mspx?mfr=true" target="_blank">http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_ksrm.mspx?mfr=true</a> for more details.</p><p></p><p>[CODE]Set colMonitoredEvents = GetObject("winmgmts:").ExecNotificationQuery("Select * from Win32_PowerManagementEvent") </p><p>Set WshShell = WScript.CreateObject("WScript.Shell")</p><p>Do</p><p> Set strLatestEvent = colMonitoredEvents.NextEvent</p><p> Select Case strLatestEvent.EventType</p><p> </p><p> case 4</p><p> ' Entering Suspend. uses the XP command taskkill to end a process.</p><p></p><p> WshShell.Run "d:\tools\taskkill /F /IM imon.exe", 0</p><p> </p><p> case 7</p><p> ' Resume from Suspend. Indicates that a ResumeSuspend message has been sent, enabling the computer to return to its regular power state.</p><p> WshShell.Run "C:\Progra~1\SOUNDG~1\iMON\iMON.exe", 0</p><p> </p><p> case 18</p><p> 'Resume Automatic. Indicates that the computer has awakened in response to an event. </p><p> WshShell.Run "C:\Progra~1\SOUNDG~1\iMON\iMON.exe", 0</p><p> </p><p> End Select</p><p>Loop[/CODE]</p><p></p><p>Cheers</p><p>Skoov</p></blockquote><p></p>
[QUOTE="skoov, post: 109065, member: 24844"] [b]Here's the script then[/b] Save this into a file with '.vbs' extension and then run. You can create a shortcut in your 'start up' folder to run each time windows runs. Enter any commands you want to run when the computer is suspending/hibernating in the 'case 4' section. The command taskkill is available as standard in XP Pro, but not in XP Home. Any commands when resuming go into the 'case 7' and 'case 18' sections. Depending on how the system is 'told to resume' depends which of these two cases occur, see [url]http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_ksrm.mspx?mfr=true[/url] for more details. [CODE]Set colMonitoredEvents = GetObject("winmgmts:").ExecNotificationQuery("Select * from Win32_PowerManagementEvent") Set WshShell = WScript.CreateObject("WScript.Shell") Do Set strLatestEvent = colMonitoredEvents.NextEvent Select Case strLatestEvent.EventType case 4 ' Entering Suspend. uses the XP command taskkill to end a process. WshShell.Run "d:\tools\taskkill /F /IM imon.exe", 0 case 7 ' Resume from Suspend. Indicates that a ResumeSuspend message has been sent, enabling the computer to return to its regular power state. WshShell.Run "C:\Progra~1\SOUNDG~1\iMON\iMON.exe", 0 case 18 'Resume Automatic. Indicates that the computer has awakened in response to an event. WshShell.Run "C:\Progra~1\SOUNDG~1\iMON\iMON.exe", 0 End Select Loop[/CODE] Cheers Skoov [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
HTPC Projects
HTPC Projects
Remote is dead after stand by/hibernate
Contact us
RSS
Top
Bottom