I am trying to figure where I am going wrong here. I am looking to have a webpage trigger the code below which tunnels from my web server to my application to then kick off a batch file which calls up a program and begins automation of various functions.
The executable string works, has been used in many VBA coded excel macros or in other batch files. The above code also works when I save it as a .VBS file and double click on it from any computer on the network and tunnels to the application server like it should. Thinking that ASP shares the VBScript language, I thought this would work without much headache.
And it does work, sort of. I can see in the task manager of my web server that the application PSEXEC is running under the user "NETWORK SERVICE" but just hangs out until it is killed by the garbage collector. This code normally does its thing in less than a second, so there is no reason for the application to just be sitting there unless it is hung.
Any thoughts or other suggestions to accomplish my goal? Doesn't have to be ASP, just trigger the script from a webpage and successfully execute.
Code:
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
RemoteFile = "e:\local_execute.bat"
Set oExec = WshShell.Exec("psexec -d -i 1 -u username -p password \\applicationserver " & RemoteFile & "")
The executable string works, has been used in many VBA coded excel macros or in other batch files. The above code also works when I save it as a .VBS file and double click on it from any computer on the network and tunnels to the application server like it should. Thinking that ASP shares the VBScript language, I thought this would work without much headache.
And it does work, sort of. I can see in the task manager of my web server that the application PSEXEC is running under the user "NETWORK SERVICE" but just hangs out until it is killed by the garbage collector. This code normally does its thing in less than a second, so there is no reason for the application to just be sitting there unless it is hung.
Any thoughts or other suggestions to accomplish my goal? Doesn't have to be ASP, just trigger the script from a webpage and successfully execute.