karpach / remote-shutdown-pc

Remote Shutdown Manager is a windows application, which gives an ability to shutdown, suspend, hibernate PC or turn screen off using HTTP GET request.
326 stars 47 forks source link

Force shutdown... #5

Closed lucky3004 closed 4 years ago

lucky3004 commented 4 years ago

Is it possible to have a checkbox to force the shutdown/reboot, because if there are some open programs in the background the pc will not shutdown/reboot.

karpach commented 4 years ago

I added ForceShutdown command.

lucky3004 commented 4 years ago

I tried but i think you forgot to reference the force shutdown in your code/gui. Or am i just to silly using it?

karpach commented 4 years ago

You are right, I forgot to modify UI. It should be good now.

lucky3004 commented 4 years ago

Ok thanks. I tried it but still no force shutdown ;-) I took your project and changed it to force shutdown by default. normally it should work. I try it with an open notepad and unsaved file. If you like to test it. force shutdown

karpach commented 4 years ago

It should force shut down after 10 seconds, not right away.

lucky3004 commented 4 years ago

I know. I saw it in your code but i wait longer and it is not shutting down. If i wait longer than 30 sec the lockscreen will appear.

karpach commented 4 years ago

I double-checked on my PC, it shuts down PC in 10 seconds. What version of Windows do you have? I have Windows 10 x64.

Can you try to run the command manually from command prompt:

shutdown /s /f /t 10

lucky3004 commented 4 years ago

Do you have something opened that is not saved, when you try to shutdown? I use Win 10 Pro x64 1909 with current CU. Following: I tried your v1.0.26 and if i select "Force Shutdown" it is not working. But if i use a your code and add to the normal shutdown the /f parameter it works. Only in force shutdown it is not working ;-)

karpach commented 4 years ago

I opened notepad and typed something in it, didn't save it. Then in the app settings changed command to "Force Shutdown". Then I clicked on the "Force Shutdown" option in the app menu. The system shuted down in about 10 seconds.

Can you try to run "shutdown /s /f /t 10" command in the command prompt on its own?

I'll try to run v1.0.26 executable. In my test, I ran my local compile version. v1.0.26 is built on build server.

lucky3004 commented 4 years ago

I tried and the command itself is working. I send the command not with the button in your gui. I do it with the provided url. And if i do it with the button it is the same behavior like i showed you in the screenshot. Don't get me wrong, i appreciate completely what you are doing for me. I am trying to get bugs out of your tool ;-) Would you like to see a video?

karpach commented 4 years ago

Let me summarize:

"shutdown /s /f /t 10" command by itself is working.

However, if you use URL or menu option "Force Shutdown" in the notification area then force shutdown does not go through.

You are using v1.0.26 executable.

The video would be helpful to reproduce the problem. I'll test v1.0.26 build using URL.

lucky3004 commented 4 years ago

OMG, i am so sorry. You are completely right. As i was recording the video and trying to show you the url i was calling. I saw that i always called url/shutdown - so i called always the normal shutdown function not the force one. If i just use the default or url/forceshutdown, than it is working like expected. Really, really sorry for that. Thx a lot for your help and your patience. You are awesome

karpach commented 4 years ago

Great! You are welcome.