Jump to content

Execute scripts from webserver?

Recommended Posts

I'd like to execute an AutoIt script (compiled) from a web server. Does anyone know of a way to do this?

I'd like to execute the script, and send commandline arguments to the script.

It could be done using POST or GET.

The webserver would be running on a Windows box.

Link to comment
Share on other sites

Doesnt' sound like a good idea, for security issues, but sure it can be done.

If you can write a file ( easy in PhP or javascript ) then just have a script running in the backround on the server.

script reads file every X seconds.

when script finds certain text, it runs a different script with that text in the commandline.

I have done something like this myself in the past. I had my home computer check my website for a hidden file every so often. I made a page that would save data to a file when certain criteria were done. With php it is simple. normal page, but when ?hide=no was added to the end of the certainpage.php in the url, it would display my form.

I did it only to see if I could, and I wanted my computer to download the new patch for a game that took 3 hours, but it can have practical uses as well.

You could make a backup program, and have the server backup files when you told it to, and only ones in a certain directory as well.

That is the idea anyway, if you need practical code, it would be simple enough to write some up.

edit... I did this with messenger as well. Nice to be able to use your phone to do stuff. For most stuff, I use VNC. You can IM your computer with say your phone or any other IM client, and autoit will start up your VNC server on a preset port, and preset password. Then you can just log in and do anything as if you were there. Close VNC server and you are secure again. If you are really paranoid, have the script that turns on the server from IM grab an IP from the msg. VNC servers have that option.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

I'm not concerned with security, it's a dedicated box whose sole job will be writing to a ProLite LED sign, and it's mostly for inhouse use only. So security issues aside:

I've used the Apache webserver to do this, and in theory it lets you execute programs on teh computer if you edit a line in the httpd.conf file, but I couldn't get it to work and am not convinced it does work.

Does anyone know of a real simple webserver that lets you execute commands on teh computer? Maybe it restricts the programs you can run to a single folder, so security breaches can't cause too much trouble? (But anything, security or no security, would be welcome).

Edited by wrybread
Link to comment
Share on other sites

I found a way to do it in PHP using Apache. I had Apache running and I tried configuring it to allow this before, and had problems, and couldn't get it to work. But I just tried it, and lo and behold, it worked.

Here's the line in PHP that executes a program:

$output = shell_exec("c:/test/whatever.exe");

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...