Log in

View Full Version : How to prevent computer shotdown/restart during encode?


MonoS
9th November 2013, 11:13
Hi Mulder, will be there a chance to have an option into the launcher to disable the shotdown/restart function of windows during an encode?

It'll be very useful for me because i already wasted about 40 and more hours of very long encode because other people used the shutdown function instead of hibernation

I managed to solve my problem using this solution http://superuser.com/a/433920

Thanks a lot for the attention, i hope you'll implement a function like this

LoRd_MuldeR
9th November 2013, 14:06
I don't think this is possible, because AFAIK the Win32 API does not expose a function to prevent other uses from shutting down the computer - fortunately.

Registry hacks generally are a bad idea, because applications should not mess with the computer's configuration. Also it's not possible anyway, because "normal" processes can not change any values in HKEY_LOCAL_MACHINE. This requires special "elevated" processes, like installer programs. But Simple x264 Launcher does not request elevation! Doing so would trigger a nasty UAC dialog (http://reformedmusings.files.wordpress.com/2009/03/win7b-uac-dialog.jpg) every time we run the application. Also non-admin user would not be able to start the program at all!

BTW: In my experience, the best method to prevent your colleagues from messing with your computer is putting a big "STAY AWAY - IMPORTANT STUFF RUNNING" sign on the computer/keyboard ;)

MonoS
9th November 2013, 14:32
I encode from my home computer, and i can't keep away my family to use the pc

BTW, thanks for your answer ;)

LoRd_MuldeR
9th November 2013, 14:43
Why not make a separate user account for your family then or make them use the "guest" account?

Windows will show a fat warning, if a user attempts to shutdown the computer from his account, while other users are still logged in separately:

http://i.imgur.com/HxnFHWV.png

MonoS
9th November 2013, 16:05
There's not a big difference, from my point of view, between your solution and the superuser.com solution and i prefer to use this one because is simpler to do [both make a warning, but i need to modify only one thing instead of creating account]

Really, thanks for the attention LoRd_MuldeR

LoRd_MuldeR
9th November 2013, 16:35
There's not a big difference, from my point of view, between your solution and the superuser.com solution

Except that by making the other users use their own separate non-admin account...

1) you can make sure that they don't even "see" your program, so they can not close/abort your encoding task by accident.

2) you can forbid them to shutdown the computer, so they can only log-in and log-out, but not sutdown/restart the whole system:
1. Run "Secpol.msc" to launch Local Security Policy.
2. Navigate to Security Settings\Local Policies\User Rights Assignment\Shut down the system.
3. Remove the users or groups that you want to restrict.

3) you can be sure that nobody is going to mess with the files in your HOME directory.

MonoS
9th November 2013, 17:32
1)Fortunately it's never happened that someone aborted or closed the program and i don't think i'll never happen
3)It's not a real problem

2)Then something similar to the second solution of this (http://superuser.com/questions/649399/how-to-create-a-script-to-disable-the-shutdown-button-on-windows-7)

LoRd_MuldeR
9th November 2013, 17:58
2)Then something similar to the second solution of this (http://superuser.com/questions/649399/how-to-create-a-script-to-disable-the-shutdown-button-on-windows-7)

Except that this way shutdown/restart would be disabled for all users, so you cannot even shutdown/restart the computer yourself ;)

(Of course you could change the settings all the time as required for the moment, but I still think using separate accounts is more convenient on the long term)