Executing stuff on shutdown, plus standby stuff.

If you have a question or need help, this is the place to be.
gorman
Posts: 15
Joined: Mon Jan 26, 2009 12:33 pm

Executing stuff on shutdown, plus standby stuff.

Post by gorman » Mon Jan 26, 2009 12:35 pm

What's the exact event to use for triggering an action at shutdown? The log gets cleared...

Also, is there some function to stall standby and shutdown procedures, in order to execute specific actions?

gorman
Posts: 15
Joined: Mon Jan 26, 2009 12:33 pm

Re: Executing stuff on shutdown, plus standby stuff.

Post by gorman » Wed Jan 28, 2009 10:36 am

Anyone? I suppose it's a common enough need... and to clarify, the shutdown I'm referring to would be initiated by standard Windows procedures, otherwise my question wouldn't have any meaning.

gorman
Posts: 15
Joined: Mon Jan 26, 2009 12:33 pm

Re: Executing stuff on shutdown, plus standby stuff.

Post by gorman » Fri Jan 30, 2009 11:40 am

I hate to insist but it's a simple question. Maybe there is not a specific event, maybe it's not possible to delay standby, I don't know.

Please help me. :)

nkapur
Posts: 8
Joined: Fri Jan 30, 2009 1:42 am

Re: Executing stuff on shutdown, plus standby stuff.

Post by nkapur » Sun Feb 01, 2009 7:57 am

Typically you would define a Macro.
The macro would be triggered by an event (whatever you specify - keypress etc.)
You would define multiple actions for the Macro (whatever action you want)
The last action would be System:ShutDown

Hope that helps

gorman
Posts: 15
Joined: Mon Jan 26, 2009 12:33 pm

Re: Executing stuff on shutdown, plus standby stuff.

Post by gorman » Mon Feb 02, 2009 9:52 pm

Argh... I don't want to create a macro to shutdown the PC. I want to create a macro that gets executed when the PC is shutdown. Shutdown is the event in this case, not the action inside the macro.

I want to be able to shutdown the machine normally (Start, etc.) and have EventGhost detect this and execute something before the Shutdown happens.

nkapur
Posts: 8
Joined: Fri Jan 30, 2009 1:42 am

Re: Executing stuff on shutdown, plus standby stuff.

Post by nkapur » Tue Feb 03, 2009 12:31 am

Ahh.. I played around with it. I could create an event called System.QuerySuspend . Associated Action was "Start Program" in the options I checked "Wait till application is terminated". My action does get triggered when system is suspended however there seems to be some timeout built in too because it doesn't wait forever. So if the invoked application stays alive for too long (~15 seconds) the system is suspended anyway.

So bottom line is that if you have some quick tasks to execute which take less than 15 seconds to execute and then terminate, you could use this method. I couldn't find something similar for shutdown though.

gorman
Posts: 15
Joined: Mon Jan 26, 2009 12:33 pm

Re: Executing stuff on shutdown, plus standby stuff.

Post by gorman » Tue Feb 03, 2009 11:59 am

nkapur wrote:Ahh.. I played around with it. I could create an event called System.QuerySuspend . Associated Action was "Start Program" in the options I checked "Wait till application is terminated". My action does get triggered when system is suspended however there seems to be some timeout built in too because it doesn't wait forever. So if the invoked application stays alive for too long (~15 seconds) the system is suspended anyway.

So bottom line is that if you have some quick tasks to execute which take less than 15 seconds to execute and then terminate, you could use this method. I couldn't find something similar for shutdown though.
Yeah, I have used successfully System.QuerySuspend, because when the system wakes up the log is still there. The problem with Shutdown is that EventGhost exits and the log is deleted, so I don't know which event to target for my action.
The action I need is fast enough for suspend (which is faster than shutdown) so I should not have problems in that regard. If only I could get evidence of the right event to trigger it.

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Executing stuff on shutdown, plus standby stuff.

Post by Bitmonster » Tue Feb 03, 2009 12:34 pm

System.OnEndSession
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

gorman
Posts: 15
Joined: Mon Jan 26, 2009 12:33 pm

Re: Executing stuff on shutdown, plus standby stuff.

Post by gorman » Tue Feb 03, 2009 1:43 pm

Bitmonster wrote:System.OnEndSession
Great! Can I add that manually, without needing to drag and drop from the log window? Meaning, can I create manually an event? Maybe this is in the wiki, I haven't checked yet.

User avatar
topix
Experienced User
Posts: 441
Joined: Sat May 05, 2007 3:43 pm
Location: Germany
Contact:

Re: Executing stuff on shutdown, plus standby stuff.

Post by topix » Tue Feb 03, 2009 3:33 pm

Yes, right click your macro and add Event. Give the event the name you want, in this case "System.OnEndSession".

plasmon
Posts: 1
Joined: Fri May 02, 2014 1:57 am

Re: Executing stuff on shutdown, plus standby stuff.

Post by plasmon » Fri May 02, 2014 2:10 am

To execute task when windows is shutting down, for win 7 x64 I use :
Task.Deactivated.Desktop

Like turning off TV and amp with HDMI-CEC.

A quick trick to grab logs with for win 7 while doing a shutdown.When you open lots of programs before shutting down, windows will ask you if you want to force shutdown or not by showing you a list of running process. Press cancel before it automatically clear the list and go back in even ghost. You'll see what you are searching for in the logs, since it's still running.

blaher
Experienced User
Posts: 494
Joined: Thu Nov 17, 2011 1:27 am

Re: Executing stuff on shutdown, plus standby stuff.

Post by blaher » Sat May 03, 2014 12:58 am


Foune
Experienced User
Posts: 96
Joined: Sun Jul 03, 2011 7:08 pm

Re: Executing stuff on shutdown, plus standby stuff.

Post by Foune » Sat May 13, 2017 12:45 am

Main.OnClose works on my computer, while System.OnEndSession doesn't

loveleejohn
Experienced User
Posts: 133
Joined: Thu Dec 10, 2015 12:09 am

Re: Executing stuff on shutdown, plus standby stuff.

Post by loveleejohn » Sun May 14, 2017 1:28 am

Foune wrote:Main.OnClose works on my computer, while System.OnEndSession doesn't
Hi there Foune. Have you tried Main.OnEndSession instead of System.OnEndSession to get events to fire when windows shuts down? It's working for me on Windows 10 64 bit. Here's a thread with some info that might help. http://www.eventghost.org/forum/viewtop ... f=2&t=2011

User avatar
kgschlosser
Site Admin
Posts: 5446
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: Executing stuff on shutdown, plus standby stuff.

Post by kgschlosser » Sun May 14, 2017 10:28 pm

Here are the list of events that are generated relating to logging off and on and suspend types of things

Main.OnInit
Main.OnClose
Main.OnEndSession
System.ConsoleConnect
System.ConsoleDisconnect
System.RemoteConnect
System.RemoteDisconnect
System.SessionLogon
System.SessionLogoff
System.SessionLock
System.SessionUnlock
System.SessionRemoteControl
System.Suspend
System.Resume
System.ResumeAutomatic
System.AwayMode.Entering
System.AwayMode.Exiting
If you like the work I have been doing then feel free to Image

Post Reply