Sign in to follow this  
Followers 0
Borje

Run a program before windows close

13 posts in this topic

Hi all Autoit freinds

I need some help with a command that checks when I close the windows a program should run

before windows close. I think it must be some check that detect some process and when the criteria is meet

than the cleaning start before the close process continue..

Is that possible?

Perhaps someone can give a example many thanks.

Share this post


Link to post
Share on other sites



Search the forum for "windows shutdown" and you'll find a lot of entries.

One way ist to change the group policy as described in this post.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

FileWare has a free utility called LastChance that intercepts after the user has seleceted shutdown/reboot/logoff and runs whatever program you select.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Just register WM_ENDSESSION message. There are plenty of examples around.

edit:

Just as a side note, we are on programming forum. We should share code, not utilities or whatever.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Just intersept the "Shut Down Window" with your own version?

WinActive.


Share this post


Link to post
Share on other sites

Thanks all for the tips...

I am not so shure what i must do I am not so familiar with WM_ENDSESSION command perhaps someone have som idea..

I want to have a function that check if I press the close button or shutdown(5) then hook the close process and run my backup and

then continue the close process.

Share this post


Link to post
Share on other sites

Search the forum for WM_ENDSESSION (as I've done) and you'll find examples like this.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I have test that exaple that water link to but the only way to have that to work is when the window logout or restart or close is visible

but not if I send a command shutdown(5) from a script, is that possible to do that?

Share this post


Link to post
Share on other sites

Is there anybody here that have some tips what to do i have test some examples but can not figure it out how to detect the

shutdown(5), in the close window that works but not when i send shutdown(5)

Share this post


Link to post
Share on other sites

Is it possible that you still haven't figured out what's expected of you?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

I have test the example that water link to, and thats works if a press the button start and then go to close

but if I do a little script with command shutdown(5) an running that not working, so my question is are that possible

to do something to have that working too?

Share this post


Link to post
Share on other sites

And you think that's it?

...ahhh


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Nowbody know ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0