What are the differences between shutdown options
-
- Posts: 74
- Joined: 21 Mar 2023, 11:23
What are the differences between shutdown options
Hello. I was wondering what the differences are between the shutdown integers seen on the tutorial pages.
Namely, what is the difference between 1 - shutdown, 4 - force shutdown, 8 - power down.
My guess is that shutdown allows all processes to end. Forced shutdown closes any programs that might be not functional. Power down is like pulling the plug?
AutoHotKeys also allow us to use a combination of functions such as 5 (shutdown + force shutdown) and 9 (shutdown + power down).
My main question is when would one use each situation? Which is the best way to shutdown the computer (1 vs 4 vs 5 vs 8 vs 9)? My guess is that shutdown (1) is the most common way that most people shut off their computer. I have seen the opinion stating that shutdown isn't the best way if one has fast boot selected. I do not have fast boot selected so I think that my computer is completely ending all processes when I shut off my computer.
Thanks for any insight.
Namely, what is the difference between 1 - shutdown, 4 - force shutdown, 8 - power down.
My guess is that shutdown allows all processes to end. Forced shutdown closes any programs that might be not functional. Power down is like pulling the plug?
AutoHotKeys also allow us to use a combination of functions such as 5 (shutdown + force shutdown) and 9 (shutdown + power down).
My main question is when would one use each situation? Which is the best way to shutdown the computer (1 vs 4 vs 5 vs 8 vs 9)? My guess is that shutdown (1) is the most common way that most people shut off their computer. I have seen the opinion stating that shutdown isn't the best way if one has fast boot selected. I do not have fast boot selected so I think that my computer is completely ending all processes when I shut off my computer.
Thanks for any insight.
Re: What are the differences between shutdown options
Welcome to this AutoHotkey forum!
This question is already directly answered in the documentation.
I agree that this is confusing. I think it might refer to the old days when it was actually possible to "shut down" a computer without shutting off the power. Perhaps the fast boot also has some effect here. For some computers, this (no power-down) might still lead to a sleep state. I am not certain why a code of 9 is better than a code of 8. Others here may know more.
My approach is to try it. If it works, then I stick with it!
This question is already directly answered in the documentation.
Independent of this, the question can be answered by running your script.To shutdown and power down the flag would be 9 (shutdown + power down = 1 + 8 = 9).
I agree that this is confusing. I think it might refer to the old days when it was actually possible to "shut down" a computer without shutting off the power. Perhaps the fast boot also has some effect here. For some computers, this (no power-down) might still lead to a sleep state. I am not certain why a code of 9 is better than a code of 8. Others here may know more.
My approach is to try it. If it works, then I stick with it!
Re: What are the differences between shutdown options
read here what the flags are doing https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-exitwindowsex
but from these explanations its not much clearer what behavior to expect on modern OSs either
but from these explanations its not much clearer what behavior to expect on modern OSs either
-
- Posts: 74
- Joined: 21 Mar 2023, 11:23
Re: What are the differences between shutdown options
Thanks. Any one of those work for me. I was just curious if there is a best practice way to avoid problems with the computer. I usually don't worry about losing data with the force start, but wondered if that would cause problems down the road.
Re: What are the differences between shutdown options
Yes, if you would prefer not to lose data, then avoid the "force" option.
Re: What are the differences between shutdown options
Yes, as far as I know there is no real difference between 4 and 8, I assume powerdown and shutdown are the same thing on modern devices.
Re: What are the differences between shutdown options
The codes are below.
0 = Logoff
1 = Shutdown
2 = Reboot
4 = Force
8 = Power down
0 = Logoff
1 = Shutdown
2 = Reboot
4 = Force
8 = Power down
-
- Posts: 74
- Joined: 21 Mar 2023, 11:23
Re: What are the differences between shutdown options
Thanks. Besides during installing and uninstalling a program, can a force shutdown adversely affect a program besides losing any data that hasn't yet been saved? I wouldn't want to damage a program (necessitating a re-installation of the program) by doing a force shutdown.
Re: What are the differences between shutdown options
No, but some programs may depend on their own configuration files that also have not been saved. The program file itself would not typically be affected, though it's possible for a program file to alter itself. This would be uncommon. A well written program would not be fatally affected by a forced restart or forced shutdown.
-
- Posts: 74
- Joined: 21 Mar 2023, 11:23