0

Is it possible for me to make my computer run a batch file through a web command? To make it more clear let me try to explain what i am trying to achieve. I want to run a squid proxy server on a computer, however i want to be able to administrate the proxy from anywhere, so i want to create my own web interface to do that.

However, i have tried to look around and there is only webmin that allows me to do it, but that's a third party software so i really don't want to use it.

Now I've seen that there are cmd commands that allow me to restart the squid server after i've made changes to the squid.conf file, which could be one way for me to achieve what i want, but i have no idea how to make the system run a batch file remotely.

If that is not possible, is there another way to achieve this purpose? Please forgive my utter ignorance i am a total newbie but i still like to try!

Thanks in advance!

1 Answer 1

0

Firstly, Webmin is focussed on Linux rather than Windows, I doubt it would work.

To answer the main question, the way to do this is to set up your own web server that can execute native commands.

Most standard web servers will allow you to set this up using CGI scripts but this isn't that secure as it comes from the early days of the web.

Better is to use a language that enables it's own web server. Both the PERL and PYTHON languages make this fairly easy but without a doubt, Node.JS is the easiest method. If you want an example of how to do this, I have a partial solution defined and up on GitHub called noderunner.

Node.JS runs fine on Windows and most other platforms and has core libraries that allow you to shell out to native commands. In my case, PowerShell but they can be Batch any anything else.

3
  • Thank you that helped a lot. However i have no experience with Noedjs but from from your answer i have gathered it is possible to do so via PHP and if done right, i won't even need a batch file since what i actually needed was to start/stop/restart a service, which can be done directly via PHP commands.
    – kvothe0153
    Mar 31, 2015 at 2:45
  • Ah, yes. I tend to forget PHP these days! Indeed you can do it via PHP & I seem to remember there is a library that should help though I've not done any PHP for quite a while. BTW, if you've done Javscript in the browser, you would have no problem picking up Node. The advantage of using Node is that it is easier to run up quick, dedicated servers anywhere. Mar 31, 2015 at 8:11
  • yes i did fiddle with javascript a bit, i'll check up on the codes and see how that fares. Thanks!
    – kvothe0153
    Apr 1, 2015 at 12:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .