I'm implementing a security mechanism which basically is supposed to "cut the power" to my computer after a certain time of inactivity. After lots of reading and testing, I've come to the conclusion that this seems to be the best and only command I could use:
shutdown /pIdeally, my system should of course also communicate wirelessly to a physical device which literally cuts the power, but that's beyond my abilities in several ways.
According to the manual:
/s = Shutdown the computer.
/p = Turn off the local computer with no time-out or warning.
/f = Force running applications to close without forewarning users.I think I tried to use /f as well, but that made it not work at all, or something. It was confusing, and it's difficult to test this since, well, the machine shuts down each time. The /s, /p and /f all seem pretty redundant, especially /p and /f.
I'm trying to avoid a situation where my script kicks in but then the computer doesn't actually shut down after all, for whatever reason. My current command seems to ignore "Do you want to save the unsaved document?" dialogue boxes which block the shutdown in normal cases, so that's good, but I can't be sure that it really works in all situations; there could be other things which "block" the shutdown, and I wish to eliminate all such possibilities, if possible.
1 Reset to default