czmaster Posted November 22, 2017 Share Posted November 22, 2017 hello, I have a script that I would not like to close before the end of its execution. If the user decides to close Windows I would like to prevent the shutdown of Windows. For that I found several examples on this forum for example this one: Blocking works well with just a While Loop execution. But if we add other autoit commands (run, inetget ...), the script is closed on closing Windows after a few seconds. Do you have any solution to prevent closing. Thank you. Link to comment Share on other sites More sharing options...
JohnOne Posted November 22, 2017 Share Posted November 22, 2017 You want to prevent a user from shutting their own device down? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Earthshine Posted November 22, 2017 Share Posted November 22, 2017 this sounds like evil doings going on. My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Developers Jos Posted November 22, 2017 Developers Share Posted November 22, 2017 5 minutes ago, Earthshine said: this sounds like evil doings going on. Isn't that statement somewhat judgmental and shouldn't that be: Why would you want to do this? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
KaFu Posted November 22, 2017 Share Posted November 22, 2017 12 hours ago, czmaster said: Blocking works well with just a While Loop execution. Fileinstall a second .exe doing just that, run it in the background as a helper process and kill it when main process is done? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
czmaster Posted November 23, 2017 Author Share Posted November 23, 2017 (edited) 12 hours ago, JohnOne said: You want to prevent a user from shutting their own device down? 12 hours ago, Earthshine said: this sounds like evil doings going on. Even with the method that works the user can allways force the shutdown in Windows, this is equivalent to an unsaved modified file that prevents Windows from closing. 12 hours ago, Jos said: Isn't that statement somewhat judgmental and shouldn't that be: Why would you want to do this? Jos Any kind of action that will take some time : backup, antivirus and personal script. Edited November 23, 2017 by czmaster Link to comment Share on other sites More sharing options...
Bert Posted November 24, 2017 Share Posted November 24, 2017 Nothing can prevent shutdown for one reason - The user can cut the power to the computer. If you are trying to push a package to the PC - it would be best to have the package install in the background while the user is using the computer. There are many resources that explain how to do it. Google is your friend. Earthshine 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
JohnOne Posted November 26, 2017 Share Posted November 26, 2017 (edited) Pulling the power is not a shutdown. Edited November 26, 2017 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Earthshine Posted November 26, 2017 Share Posted November 26, 2017 How about holding down the power button until it shuts off My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
argumentum Posted November 26, 2017 Share Posted November 26, 2017 1 hour ago, Earthshine said: holding down the power button until it shuts off is not a shutdown. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now