Forum Moderators: open

Message Too Old, No Replies

javascript to execute file on server

         

the_kraken

6:17 pm on Jun 26, 2007 (gmt 0)

10+ Year Member



I did look around a bit on the forum and couldn't find anything. Here is what I am trying to do: I have a program that sits on my server that I can run via command line with some parameters. I would like to open that up to other internal users with a webpage, so they could choose the value of the parameters, hit a button and that page would open a command line and feed the instructions to kick off that app, with the parameters. I understand there are security risks associated with this behavior, again, it is all an internal used application. Can someone point me in the right direction to do this (I tried using ActiveXObject("WScript.Shell"); to no avail). I am open to other suggestions as well, knowing that I have to execute a command line on a server from the client side. Also, any suggestions about what security settings I have to change as well. Thanks in advance.

testy

7:07 am on Jun 27, 2007 (gmt 0)

10+ Year Member



execute or run the command using the exec() function in php.

use exec() function inside a php page.

Call the php page when ever you want the command to be used.

the_kraken

1:41 pm on Jun 29, 2007 (gmt 0)

10+ Year Member



Thanks for the idea; unfortunately I am not using PHP, but ASP. I did find a method via ASP using WSH (Windows Scripting Host) which looks like it should work, but I haven't been able to get the permissions set properly yet.

Anyone have any experience with WSH?

Bernard Marx

2:06 pm on Jun 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm comfrtable(ish) with WSH. However, WSH is a separate (but in some ways similar) host environment. Roughly speaking, what ASP is to the server, WSH is to the server's host computer.

You could get ASP to run a WSH script. Scary though.