Can ASP execute a WshScript

musicman_ace

Limp Gawd
Joined
Oct 30, 2003
Messages
205
I have a script coded for WSH (Windows Scripting Host) which is essentially VB. I can not seem to run it from inside of a webpage. I know php has the ability to run system commands, but I need that type of feature for ASP. All attempts and code snip-its online have failed miserably. If someone knows how to acheive this, please help.

The scripst would usually be executed from either the commands prompt or run dialog box.

CMD style:
cscript test.vbs

Start, Run style:
wscript test.vbs
 
Why can't you just include the code in the file as a function and call that? You might need to change a bit to get it to work in the ASP page though.
 
Do you need it to run at a set interval? Or do you need it on demand?
 
Eventually I will run it on a schedule, with a button to initiate on-demand. That is If I can get the asp page to run the script. I have yet to find the fuction that allows this. Server.Execute doesn't seem to help, but maybe i'm doing it wrong. If someone could point out which function should allow this, I should be able to get back on the task.


I could probably simplify this to say, can someone post how to launch an executable, say notepad.exe, from within an asp page.

--------------
Well, the closest I've come is that I've found this on aspfree.
My ASP file
Code:
<%
Set WshShell = Server.CreateObject("WScript.Shell")
WshShell.Run "C:\Inetpub\wwwroot\test.vbs"
Set WshShell = Nothing
%>

Then for simplistic sake, test.vbs contains this

Code:
WScript.Echo "Hello World!"

It gives me a Permission Denied which is odd, since after I have now removed all security permissions and I think I've got IIS running with the least amount of security I can put on it.
 
If you have an AV program, it might be the problem. If you try to access the FSO with Norton AV, it'll fail even if the AV is turned off, it needs to be uninstalled! (Run the AV from another machine instead).
 
Back
Top