MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Help on Development » Improvement Suggestions


Improvement Suggestions You have an idea how MediaPortal could be improved? Post it in here.

Reply
 
Thread Tools Display Modes
Old 2006-08-21, 03:32   #1 (permalink)
Portal Member
 
dipunm's Avatar
 
Join Date: Aug 2006
Age: 21
Posts: 66
Thanks: 2
Thanked 1 Time in 1 Post


Question Command Line tool to run on start/standby/resume/shutdown etc...

After ALOT of jumping around, and installing meaningless programmes, slowing my pc down by the minute, i found (ON THIS FORUM!! YAY ) the info about command line tools for ir blaster

now, i think this prog works only for mce version blaster (the 1 that comes with the mce remote) but thats all i needed. Now, my main prob is that i can't get the batch file i made to run on windows resume and standby (can set it for startup and found a prog for shutdown) (i use it to turn my tv on/off and change av 4 times)

considering i will use mp to standby etc, i figured that mp should run tthese commands, but a command tool would allow for ANYTHING to be done on mp startup/shutdown/etc.

pls consider this
dipunm is offline   Reply With Quote
Old 2006-08-21, 03:42   #2 (permalink)
Portal Member
 
zombiepig's Avatar
 
Join Date: Mar 2005
Location: Melb, Aus
Age: 27
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

i agree - this would be a very handy feature. for what it's worth i was trying to do the same thing you are, sending a remote code on standby/resume, and ended up using a vb script i found through google. it kinda works... but it's pretty clunky and only allows me to send a single ir code before standby. If you'd like i can post the script when I'm back in front of my mp machine!
__________________
my ongoing htpc project!

my music taste last week was:
zombiepig is offline   Reply With Quote
Old 2006-08-21, 08:50   #3 (permalink)
Portal Member
 
CHli's Avatar
 
Join Date: Jul 2005
Location: Switzerland
Age: 27
Posts: 1,017
Thanks: 9
Thanked 3 Times in 3 Posts

My System

Default

Quote:
Originally Posted by dipunm View Post
i use it to turn my tv on/off and change av 4 times)
I would like the same here, can you post your script with a little how to ? Which tools etc... ? Thank you very much.
CHli is offline   Reply With Quote
Old 2006-08-21, 10:07   #4 (permalink)
Portal Member
 
zombiepig's Avatar
 
Join Date: Mar 2005
Location: Melb, Aus
Age: 27
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

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 http://burningzeroad.free.fr/MceIrApi.rar 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
(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
__________________
my ongoing htpc project!

my music taste last week was:

Last edited by zombiepig; 2006-08-22 at 00:54.
zombiepig is offline   Reply With Quote
Old 2006-08-21, 10:15   #5 (permalink)
Portal Member
 
CHli's Avatar
 
Join Date: Jul 2005
Location: Switzerland
Age: 27
Posts: 1,017
Thanks: 9
Thanked 3 Times in 3 Posts

My System

Default

thank you very much ! I'll give this a try tonight.

Edit : I think the first character of your script is missing

Last edited by CHli; 2006-08-21 at 11:03.
CHli is offline   Reply With Quote
Old 2006-08-21, 21:36   #6 (permalink)
Portal Member
 
dipunm's Avatar
 
Join Date: Aug 2006
Age: 21
Posts: 66
Thanks: 2
Thanked 1 Time in 1 Post


Wow

Hey thanx for the quick reply, sorry i wast here to read it in time

Ive noticed you have a loop, do you have a description of how the script works?
I was thinking of putting a flag in the program ie. (wat for end) but not shure YET how to do this,. wen i find out ill post it (if its possible) also, thnx agen for input, i hope we can make it work

ps. i used the same command line tool.

to use the command line tool

use 'MceIrRec -o <insert filename>' and then press the key on your remote (sat/tv remote) that does the function you want it to...
Do this in command prompt (goto run, type cmd then type cd <insert directory of folder where files are> then type the command above)

eg.
mceirrec -o onoff.irk

then to play, basically call MceIrPlay -i <insert filename> -b <insert port number:1 or 2>


eg.
mceirplay -i onoff.irk -b 1

finally, creating a batch file, open notepad and write each command on a separate line for each recording you want to play

eg.
mceirplay -i onoff.irk -b 1
sleep 1
mceirplay -i av.irk -b 1
sleep 1
mceirplay -i av.irk -b 1
sleep 1
mceirplay -i av.irk -b 1
sleep 1
mceirplay -i av.irk -b 1

save as <insert filename>.bat

this will turn on my tv and press av 4 times

make sure file type is set to any otherwise youll get <filename>.bat.txt and it wont run

sleep 1 is a command to make the batch file wait 1 second before continuing (http://www.computerhope.com/download/utility/sleep.exe)


IMPORTANT
All files must be in same directory
dipunm is offline   Reply With Quote
Old 2006-08-21, 22:58   #7 (permalink)
Portal Member
 
CHli's Avatar
 
Join Date: Jul 2005
Location: Switzerland
Age: 27
Posts: 1,017
Thanks: 9
Thanked 3 Times in 3 Posts

My System

Default

Thanks EqualRightsForWerewolves I managed to get it working without problem with your vbscript.

Thanks to dipunm too.
CHli is offline   Reply With Quote
Old 2006-08-22, 00:55   #8 (permalink)
Portal Member
 
zombiepig's Avatar
 
Join Date: Mar 2005
Location: Melb, Aus
Age: 27
Posts: 408
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

i can't really claim credit for that script - i found it on some random newsgroup after searching around for ages!
__________________
my ongoing htpc project!

my music taste last week was:
zombiepig is offline   Reply With Quote
Old 2006-08-22, 01:08   #9 (permalink)
Portal Member
 
dipunm's Avatar
 
Join Date: Aug 2006
Age: 21
Posts: 66
Thanks: 2
Thanked 1 Time in 1 Post


Default

theres only 1 thing i dont like about it... its running constantly in the background and its never idle

if i cant find another way ill use it, but i dont like that idea although windows probably dus the same thing at a huger scale :p
dipunm is offline   Reply With Quote
Old 2006-08-22, 07:59   #10 (permalink)
Portal Member
 
CHli's Avatar
 
Join Date: Jul 2005
Location: Switzerland
Age: 27
Posts: 1,017
Thanks: 9
Thanked 3 Times in 3 Posts

My System

Default

I have to check for CPU usage with that script, but I haven't notice anything since I'm using it.
CHli is offline   Reply With Quote
Reply

Bookmarks

Tags
command, line, run, tool

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Resolving standby issues - MCE Standby tool mba General Support 7 2007-11-29 15:47
Useful Tool : DPCLAT (stuttering/dropped frames) bigj General Support 2 2007-06-28 20:26
SVN update tool Brutus Plugins 2 2006-06-23 22:03
Tool for checking DVR-MS files (or extract .ts)? ziphnor Codecs, External Players 0 2006-06-04 13:18
MPEG2 to Xvid converter with commercial removal - tool pgoth OffTopic 2 2005-09-14 12:22


All times are GMT +1. The time now is 16:23.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden