Hi I wanted to have a shutdown button on my website that would power off the computer. I tried <td><a href="file:///C:/Windows/System32/shutdown.exe/p"><b><i>Shutdown</i></b></td>
but it does not work I'm sure I had it working a few years ago but can't seem to get it to work any more... Can anyone offer any suggestions.
Asked
Active
Viewed 4,646 times
-1

user2988869
- 21
- 1
- 5
-
I'm also curious about the application for this. Where might this be useful? – keeehlan Jul 20 '15 at 17:25
-
Browsers can not execute system files from an href. You need something like active x, java or an alternative to execute system files. – Aziz Saleh Jul 20 '15 at 17:33
-
It is not useful, there is almost no useful application for this. Even in an internal network this has almost no use whatsoever. This would be useful if the OP was asking to restart a computer, but shutting down has almost no useful application on an internal network. And in any which way you look at this, anyone who should be shutting down computers remotely should be IT personnel and would have access to a server from which they could perform these actions anyway, like SBS console – ctwheels Jul 20 '15 at 17:34
-
Check this answer.. http://stackoverflow.com/questions/18980957/is-it-possible-to-run-an-exe-or-bat-file-on-onclick-in-html – Spade Jul 20 '15 at 17:34
-
1In your php.ini file, remove everything after the `=` sign on this line: `disable_functions = exec` and then create a php file and have the link of your anchor tag point to a script that has the following code in it: `` or `system('shutdown -r now');` This does amazing things (assuming you have a linux server). Or use `system('shutdown -t -s 0');` for Windows! – ctwheels Jul 20 '15 at 17:39
-
Will you explain why you want to shutdown the computer via webpage? – Techie Jul 20 '15 at 17:42
-
See page www.sheeno.ie It's use is for when you are tierd and want to shutdown your computer quickly when you have finished your nights entertainment on the site. – user2988869 Jul 20 '15 at 18:03
2 Answers
0
For security reasons. Browsers have only limited access. If you need to have a page that's capable of shutting down the host computer (server) you could use a server side language like PHP for that. If you need to shut down the client I would recommend looking for a plugin.
If the page is a non-hosted html file (on your local machine) you could consider running a standalone server behind with very basic logic to perform the shutdown.

Sven van de Scheur
- 1,809
- 2
- 15
- 31
-
It is hosted on a server but it is to shutdown the client computer. I am not to sure of the basic logic you are talking about could you maybe give me an example – user2988869 Jul 20 '15 at 18:06
-
With basic logic I ment some code thats runs on the server that calls a shutdown. Because the server is not the same as the client, this is not going to work. Perhaps starting your browser with lower (or disabled) security settings may make your original example work again. However: be aware of the security risks... – Sven van de Scheur Jul 20 '15 at 18:09
-
0
You can use Neutralinojs to call kernel functions and system commands with HTML and Javascript via browser

Shalitha Suranga
- 1,138
- 8
- 24