vbscript
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
vbscript [2013/02/18 11:52] – skipidar | vbscript [2020/12/27 20:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== Run on WakeUp ==== | ||
+ | To Run a batch on WakeUp from Sleep, use VbScript. | ||
+ | |||
+ | Save the following as ***.vbs** | ||
+ | |||
+ | < | ||
+ | Set oShell = CreateObject(" | ||
+ | |||
+ | Set colMonitoredEvents = GetObject(" | ||
+ | ExecNotificationQuery(" | ||
+ | |||
+ | Do | ||
+ | Set objLatestEvent = colMonitoredEvents.NextEvent | ||
+ | |||
+ | Select Case objLatestEvent.EventType | ||
+ | |||
+ | Case 4 | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | Case 7 | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | Case 11 | ||
+ | ' | ||
+ | ' | ||
+ | |||
+ | Case 18 | ||
+ | ' | ||
+ | | ||
+ | |||
+ | End Select | ||
+ | Loop | ||
+ | </ | ||
+ | |||
+ | The batch file could look as following: | ||
+ | < | ||
+ | :: Restart Outlook, because there are connection problems on wake up | ||
+ | TASKKILL /F /IM " | ||
+ | |||
+ | ::runas /profiles /env /savecred / | ||
+ | :: START " | ||
+ | :: C: | ||
+ | |||
+ | :: start the login script | ||
+ | START D: | ||
+ | |||
+ | :: bring existing Outlook windows to top or open a new one | ||
+ | START OUTLOOK.EXE /recycle | ||
+ | </ |