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
MediaPortal 1
Development
Improvement Suggestions
Command Line tool to run on start/standby/resume/shutdown etc...
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="zombiepig" data-source="post: 71713" data-attributes="member: 12049"><p>ok - put the following in a text file, named resume.vbs. then put a shortcut to the file in the startup group. </p><p></p><p>this script will run suspend.bat on suspend, and resume.bat on resume.</p><p>i'm using the mceirplay utility from <a href="http://burningzeroad.free.fr/MceIrApi.rar" target="_blank">http://burningzeroad.free.fr/MceIrApi.rar</a> to playback recorded ir commands to switch on/off the tv and jump to the av input.</p><p></p><p>[code]</p><p>Set oShell = CreateObject("WScript.Shell")</p><p>Set colMonitoredEvents = GetObject("winmgmts:")._</p><p> ExecNotificationQuery("Select * from Win32_PowerManagementEvent")</p><p></p><p>Do</p><p> Set objLatestEvent = colMonitoredEvents.NextEvent</p><p></p><p> Select Case objLatestEvent.EventType</p><p> Case 4</p><p>oShell.Run "suspend.bat", 0, true</p><p> Case 7</p><p>oShell.Run "resume.bat", 0, true</p><p> End Select</p><p>Loop </p><p></p><p>[/code]</p><p></p><p>(edit - this is really annoying - i edited the script to fix a character and now it's ignoring any new lines i'm putting in. if you hit quote to this post you should still be able to see it properly <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite4" alt=":mad:" title="Mad :mad:" loading="lazy" data-shortname=":mad:" />)</p><p></p><p>one catch is that suspend.bat has to be short. i can only send one ir command before the system suspends. that's why i'd ideally like to see an inbuilt mp option to run a command before suspend <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p></blockquote><p></p>
[QUOTE="zombiepig, post: 71713, member: 12049"] ok - put the following in a text file, named resume.vbs. then put a shortcut to the file in the startup group. this script will run suspend.bat on suspend, and resume.bat on resume. i'm using the mceirplay utility from [url]http://burningzeroad.free.fr/MceIrApi.rar[/url] to playback recorded ir commands to switch on/off the tv and jump to the av input. [code] Set oShell = CreateObject("WScript.Shell") Set colMonitoredEvents = GetObject("winmgmts:")._ ExecNotificationQuery("Select * from Win32_PowerManagementEvent") Do Set objLatestEvent = colMonitoredEvents.NextEvent Select Case objLatestEvent.EventType Case 4 oShell.Run "suspend.bat", 0, true Case 7 oShell.Run "resume.bat", 0, true End Select Loop [/code] (edit - this is really annoying - i edited the script to fix a character and now it's ignoring any new lines i'm putting in. if you hit quote to this post you should still be able to see it properly :@) one catch is that suspend.bat has to be short. i can only send one ir command before the system suspends. that's why i'd ideally like to see an inbuilt mp option to run a command before suspend ;) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
Improvement Suggestions
Command Line tool to run on start/standby/resume/shutdown etc...
Contact us
RSS
Top
Bottom