0

I would like to build a mini web app type page on my local machine where I can run CMD commands.

For example, my ideal set up would be over the Internet I can go to WANIP:1111, get prompted for user/pass and then be presented with a page where I can do things like reboot the machine and so on using commands such as shutdown.exe -r.

I'm basically looking for the functionality of the Web Interface option of the Shutter program by den4b but I'd like to build it and customize it myself. I'm also assuming that I wouldn't have to run an additional program to do it the way I described.

How would I go about creating this?
Do I need a certain server? Certain technology?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Vian Esterhuizen
  • 3,788
  • 4
  • 27
  • 37
  • OK - what have you done so far? – Diodeus - James MacFarlane Oct 16 '12 at 20:00
  • @Diodeus Well, the original question was asking what I would need to do to set this up from scratch. IE: I would have to set up a webserver on my local machine, forwards some ports, open some firewalls and so on. I'm not sure what to do. So far I've tried setting up an IIS server but I can't access it from outside http://serverfault.com/questions/438979/access-iis-site-one-windows-7-home-premium-over-the-internet but can't seem to make it work. I'm familiar with PHP more so than .NET is it possible to do with PHP? – Vian Esterhuizen Oct 16 '12 at 20:36
  • @Diodeus Any help and suggestions to make the question better would be much appreciated. – Vian Esterhuizen Oct 16 '12 at 20:36
  • This may help: http://stackoverflow.com/questions/2790071/starting-a-process-from-a-net-windows-service – Diodeus - James MacFarlane Oct 16 '12 at 20:37

1 Answers1

1

short PHP solution:

  1. Install Apache and PHP
  2. Secure it with htaccess
  3. Use exec to run commands

Here is discussion about how to shutdown a pc using php with working code. And here are instructions to change the port apache listens to.

That should be all information you need to install the server and build a php script with the desired functionality.

Community
  • 1
  • 1
Trudbert
  • 3,178
  • 14
  • 14