RE: WSCRIPT.SHELL(Run) in ASP

From: Dave Alvarado (anonymous_at_discussions.microsoft.com)
Date: 05/27/04


Date: Thu, 27 May 2004 12:11:07 -0700

Another couple things to check:

-Is the script ending before the Run statement finishes? Normally I'll use the Exec method instead of Run, and check for the status of the returned object to not be zero, and sleep if it is. For example:

Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec("SomeCommand.exe")
Do Until oExec.Status <> 0
    WScript.Sleep 100
Loop
Set oExec = Nothing
Set oShell = Nothing

-Do you have a permissions problem that's causing the script not to run? Remember that in the ASP page, you'll typically be running as the IUSR account, but when you do a Start -> Run, you're running as yourself.



Relevant Pages

  • return an object from a function
    ... I am pretty new to wsh programming and got the following question. ... Set oShell = Wscript.CreateObject ... Set oExec = Nothing ... Microsoft VBScript runtime error: Object ...
    (microsoft.public.scripting.vbscript)
  • Re: Computer name in ASP
    ... Dim oShell, oExec, sCommand, sOutput ... ''watch for line wrap - begin ... Set oShell = CreateObject ... Set oExec = Nothing ...
    (microsoft.public.inetserver.asp.general)
  • Re: FSO
    ... I don't believe the FSO has a method to retreive that information. ... Dim oShell, sCommand, oExec, sOutput ... Set oShell = CreateObject ... Set oExec = Nothing ...
    (microsoft.public.scripting.vbscript)
  • Re: value from commanline-tool
    ... Dim oShell, oExec, sCommand, sOutput ... Set oShell = Server.CreateObject ... Set oExec = Nothing ...
    (microsoft.public.inetserver.asp.general)
  • Re: SNTP
    ... I think you may run into permissions issues though that ... Dim sCommand, oShell, oExec ... Set oExec = Nothing ... Set oShell = Nothing ...
    (microsoft.public.inetserver.asp.general)