Solved

run script after standby windows xp

Posted on 2009-07-01
3
734 Views
Last Modified: 2012-05-07
Hi Experts,

I have a customer that we have created a script to automatically run a dialup network connection / vpn connection / rdp connection on computer startup. The scripts work well. I would like to however have these scripts automatically run when the computer comes out of standby.

Is there a way to automatically run batch scripts out of standby?

Thanks
smbcs
0
Comment
Question by:smbcs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 4

Expert Comment

by:asrdias
ID: 24761396
Try this:

Reference documentation here: http://msdn.microsoft.com/en-us/library/aa394362(VS.85).aspx

Example Script...

'Script type VBS starts'

Set oShell = CreateObject("WScript.Shell")
Set colMonitoredEvents = GetObject("winmgmts:").ExecNotificationQuery("Select * from Win32_PowerManagementEvent")
Do
  Set oSuspend = colMonitoredEvents.NextEvent
  If oSuspend.EventType = 7 Then
    'Here you insert the code to lauch whatever you need'
    MsgBox "Waking up !"
  End If
Loop

'Script Ends
0
 
LVL 4

Accepted Solution

by:
asrdias earned 500 total points
ID: 24761408
Posting the script again due to line break...

Example Script...

'Script type VBS starts'

Set oShell = CreateObject("WScript.Shell")
Set colMonitoredEvents = GetObject("winmgmts:").
_ExecNotificationQuery("Select * from Win32_PowerManagementEvent")

Do
  Set oSuspend = colMonitoredEvents.NextEvent
  If oSuspend.EventType = 7 Then
    'Here you insert the code to lauch whatever you need'
    MsgBox "Waking up !"
  End If
Loop

'Script Ends
0

Featured Post

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question