- WSHSHELL.EXEC error in ASP Web Page 
Author Message
 - WSHSHELL.EXEC error in ASP Web Page

      Dim oWShell, oExec, CmdStr, StrEXEResult, oFPath
       oFPath = "C:\Inetpub\WWWRoot\PACER\"
       Set oWShell = CreateObject("WScript.Shell")
       Set oExec = oWShell.Exec(oFPath&"GoWeb.bat ")
       StrEXEResult = oExec.StdOut.Readall()
       WScript.Echo oExec.Status

When I try to run this script from an ASP page, I have gotten:
  1) Access Denied when running a batch file to run the VBS WSH Script.
  2) Not a valid Win NT application when trying to run the VBS script directly.
  3) It just hangs if I try to run an executable.

  Input and ideas please.



Mon, 22 Aug 2005 03:47:57 GMT  
 - WSHSHELL.EXEC error in ASP Web Page
A VBS isn't a Win32 application.
Your VBS file must be passed as parameter to wscript.exe
Try this code:

Dim wss : wss = Server.CreateObject("WScript.Shell")
wss.Run "wscript.exe " & myVBS.vbs

Note: wscript.exe is located in System32 folder.

Quote:
>-----Original Message-----
>      Dim oWShell, oExec, CmdStr, StrEXEResult, oFPath
>       oFPath = "C:\Inetpub\WWWRoot\PACER\"
>       Set oWShell = CreateObject("WScript.Shell")
>       Set oExec = oWShell.Exec(oFPath&"GoWeb.bat ")
>       StrEXEResult = oExec.StdOut.Readall()
>       WScript.Echo oExec.Status

>When I try to run this script from an ASP page, I have
gotten:
>  1) Access Denied when running a batch file to run the
VBS WSH Script.
>  2) Not a valid Win NT application when trying to run

the VBS script directly.
Quote:
>  3) It just hangs if I try to run an executable.

>  Input and ideas please.
>.



Mon, 22 Aug 2005 16:59:22 GMT  
 - WSHSHELL.EXEC error in ASP Web Page
Sorry, my previouse sample code was in ASP. Please,
use "WScript.CreateObject" (not "Server.CreateObject")
Quote:
>-----Original Message-----
>A VBS isn't a Win32 application.
>Your VBS file must be passed as parameter to wscript.exe
>Try this code:

>Dim wss : wss = Server.CreateObject("WScript.Shell")
>wss.Run "wscript.exe " & myVBS.vbs

>Note: wscript.exe is located in System32 folder.

>>-----Original Message-----
>>      Dim oWShell, oExec, CmdStr, StrEXEResult, oFPath
>>       oFPath = "C:\Inetpub\WWWRoot\PACER\"
>>       Set oWShell = CreateObject("WScript.Shell")
>>       Set oExec = oWShell.Exec(oFPath&"GoWeb.bat ")
>>       StrEXEResult = oExec.StdOut.Readall()
>>       WScript.Echo oExec.Status

>>When I try to run this script from an ASP page, I have
>gotten:
>>  1) Access Denied when running a batch file to run the
>VBS WSH Script.
>>  2) Not a valid Win NT application when trying to run
>the VBS script directly.
>>  3) It just hangs if I try to run an executable.

>>  Input and ideas please.
>>.

>.



Mon, 22 Aug 2005 22:08:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. WshShell.Run vs WshShell.Exec

2. runas with WshShell.Exec versus WshShell.Run

3. Problem using WshShell.Exec

4. Exec ISAPI DLL from ASP (SSI command exec ?)

5. How to wait for termination of program started with WshShell.Exec

6. using WshShell.Exec

7. WshShell.Exec Passing Invalid Argument to CL App

8. WshShell.Exec what is wrong?

9. WSH 5.6 WshShell.Exec - Minimized Window?

10. Basic WshShell.Exec problem

11. WshShell.Exec: reaping return codes and waiting for termination

12. q: asynch piping of WshShell.Exec.StdOut

 

 
Powered by phpBB® Forum Software