Forum Wiki SponsorShop
17 October 2018, 07:41:26 English Nederlands *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Leden hebben meer voordelen dus registreer je snel als lid!! Voordelen van een registratie zijn oa: Zelf kunnen posten op het forum - mogelijkheid van emailnotificatie als er een reactie is op een je eigen posting - mogelijkheid van email notificatie op een nieuwe posting op een onderwerp van een ander dat je wilt vervolgen - private mail kunnen ontvangen en verzenden naar andere forum gebruikers - overzicht van nog niet gelezen postings - toegang tot lezen en plaatsen van berichten in het vraag&aanbod forum -
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Updated: Running scripts and programs  (Read 8374 times)
hveijk
Moderator
Guru
*****

Karma: 7
Offline Offline

Posts: 691



WWW
« on: 20 July 2011, 12:32:30 »

In the latest versions I made some changes to the possibility to run scripts or programs on certain events. In this thread I will give an update to reflect the new situation.

Details about the old situation can be found in this thread.

The registry values from earlier versions are renamed and a number of new values are added. Any values you might have entered in the old situation will automatically be converted once a "new" MST is being run for the first time.

To run something at a specific event the corresponding registry value has to contain the full path to the script or program. These values can be found in the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Herman van Eijk\MceStandbyTool

In case you are running a 64 bit version of windows the key will be:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Herman van Eijk\MceStandbyTool

The following values that can be used to enter a run item:

RunOnAutoResume
This item will be run when the system resumes for an automatic task (scheduled recording/guide download).
RunOnAutoSuspend
This item will be run when the system suspends from an automatic task (scheduled recording/guide update).
RunOnAutoSuspendEarly
This item is simular to RunOnAutoSuspend but will be called a little earlier in the suspend process (using this might delay critical actions like the closing of ehome and cause issues because of this, not recommended).
RunOnAway
This item will be run when the system enters Away mode. Normally Away mode is entered when the system is suspended during a recording.
RunOnAwayResume
This item will be run when the system is taken out of Away mode by a user generating some input (key press/mouse move).
RunOnDisplayOn
This item will be run when the system switches the display on.
RunOnDisplayOff
This item will be run when the system switches the display off.
RunOnReboot
This item will be run when MST initiates the automatic reboot.
RunOnUserInterfaceResume
This item will be run when the system enters the mode where the user interface is available. This happens when the system resume is initiated by the user (remote/power button etc.) or the user takes control of the system during an unattended recording.
RunOnUserResume
This item will be run when the system resumes, initiated by the user (remote/power button etc.).
RunOnUserSuspend
This item will be run when the system is suspended form the user interface (not from and auto resume).
RunOnUserSuspendEarly
This item is similar to RunOnUserSuspend but will be called a little earlier in the suspend process (using this might delay critical actions like the closing of ehome and cause issues because of this, not recommended).

For each run item I added a "Flags" value that gives some control about how the item will be run. In this value each bit has a meaning, add the values of the bits to combine the options:

Bit
Value
Function
0
1
Run in a CMD shell (used to call "DOS" commands and for debugging)
1
2
Hide the output window
2
4
Wait until finished, will also log the exit code
3
8
Do not exit the CMD shell (for debugging)
4
16
Pause the CMD shell when the exit code indicated an error
5
32
Use the system directory, otherwise the current directory will be used
6
64
Save the output to a file in the temp directory, can only be used when run in a CMD shell
7
128
Force to run with admin rights
8
256
Force to run without admin rights

For most situations the default Flags will do fine. You might want to change them (temporary) for debugging purposes.

Warning

The time available to run something at suspend is limited. From the moment the suspend is initiated (by pressing the off button or detecting the system is idle) there system will wait limited time to finish the run item before it will enter the suspend state, even if things did not finish. There is nothing MST can do about that!

- On Windows XP the timeout to finish things officially is 20 seconds.
- On Windows Vista/7 this is 2 seconds.

These timeouts are guaranteed, in practice they will be a little longer due to some actions the system has to finish.

Trying to run anything that lasts too long might cause it to be finished at the next resume

Note

When using hibernate (S4) or hybrid sleep (S3+S4) the system will not be able to distinguish user wakes from wakes for automatic tasks. I strongly recommend using standby (S3) for media center PCs.

Finally

This post gives you all the information you might need to configure and debug your setup.

Keep in mind this is pretty advanced material. You will need a certain level of DOS/Windows knowledge to understand the details.
     
Herman
Logged

Slick Solutions (subforum) - MCE Standby Tool, LEDSdriver, Slick Radio
Al eens gekeken in de "degroeneknop sponsorshop"?
Met de aanschaf van artikel uit de sponsorshop steun je het DGK initiatief en voor de prijs hoef je het niet te laten want die is gunstig!

DigitalDevices DVB tuners KeuzeBundel
(black) MediaCenter AB set - 29 eur.

dus check snel
www.degroeneknop.nl/sponsorshop/
heula
Gemiddeld
***

Karma: 0
Offline Offline

Posts: 108


« Reply #1 on: 22 July 2011, 16:19:06 »

In the previous thread I had a question

Citaat van: .Nico op 19 Juli 2011, 12:35:51
perhaps you have to specify the path WOL.EXE is located, ie.

c:\tools\wol.exe 90E6BA979182

C:\Windows\ehome\mcupdate.exe

.Nico
In the same dir as the cmd file. Like I said, when I run the cmd without MST the Wol command works just fine.

Edit

Tested it with the way you mentioned and now it is working.
Thanks for the tip.


I was wrong, it is still not working.

Can someone explain why

I have tried with 3 different wol tools but they don't run with MST but standalone just fine. I need one of them to run with MST to wake my server when I wake my living room HTPC.

These 3 wol commandlines I have tried in a CMD called standbytool.cmd and is located in C:\Utilities to run with MST

C:\Utilities\wol.exe 90E6BA3AE1B1

C:\Utilities\mc-wol.exe 90:E6:BA:3A:E1:B1

C:\Windows\WolCmd.exe 90:E6:BA:3A:E1:B1 255.255.255.255 255.255.255.255

The reg file is like this.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Herman van Eijk\MceStandbyTool]
"RunOnUserResume"="C:\\Utilities\\Standbytool.cmd"
"RunOnAutoResume"="C:\\Utilities\\Standbytool.cmd"
"RunOnUserInterfaceResume"="C:\\Utilities\\Standbytool.cmd"
"RunOnAwayResume"="C:\\Utilities\\Standbytool.cmd"

Thanks for the help.
Logged
.Nico
Dé Windows Media Center specialist!
Global Moderator
Guru
*****

Karma: 16
Offline Offline

Posts: 1855


Je kunt ook deze icons gebruiken:


WWW
« Reply #2 on: 23 July 2011, 19:31:35 »

Weird! On the other hand, why put a server to sleep? Can't you just let the server run? I never put a server in sleepmode because I want to be able to connect to it 24/7, even via Internet.

Just my 2 cents...

Edit: have a look at this: http://www.degroeneknop.nl/forum/index.php/topic,7553.msg43335.html#msg43335

.Nico
« Last Edit: 23 July 2011, 19:33:52 by .Nico » Logged
heula
Gemiddeld
***

Karma: 0
Offline Offline

Posts: 108


« Reply #3 on: 24 July 2011, 09:33:29 »

Weird! On the other hand, why put a server to sleep? Can't you just let the server run? I never put a server in sleepmode because I want to be able to connect to it 24/7, even via Internet.

Just my 2 cents...

Edit: have a look at this: http://www.degroeneknop.nl/forum/index.php/topic,7553.msg43335.html#msg43335

.Nico
I have got it working with another tool.
http://mytv.senseitweb.com/media/p/25574.aspx

Works like a charm.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Dedicated Server Managed Colocatie VPS Webhosting + domeinnamen Domeinnaam registraties Linux beheer, server clustering, backup oplossingen

Powered by MySQL Powered by PHP
Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!