vbscript WshShell.exec call in ASP

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: sticky (sticky_at_hotmail.com)
Date: 04/05/04


Date: Tue, 6 Apr 2004 08:25:38 +1200

Hi,

I'm trying to get an WshShell.exec call working from within as ASP page I am
developing. I have upgraded the WSH on the server to version 5.6 and am no
longer getting the 'object doesn't support this property or method' errors.
Instead, I'm getting the error:

   WshShell.Exec error '80070002'
  The system cannot find the file specified.

  /gartner_dev/Default.asp, line 14

My code is very simple - I'm just trying to get a simple exec call working
for a start:

  Option Explicit

  Dim objExec, objWshShell

  Set objWshShell = Server.CreateObject("Wscript.Shell")

  objWshShell.exec("dir")

But even this simple code returns the error above! No matter what command I
try to exec, I get the error. Is there some component I'm missing? What file
is it looking for? I can't use the run method as I need the stdOut of the
command... although I guess I could output that to a text file, but I'd
really rather not have the overhead.

Any ideas?



Relevant Pages

  • Re: exec() gives output??
    ... > I'd like to execute a command on the server ... > particular command takes a long time to execute, ... A successful call to exec() replaces the Perl script with whatever execis ...
    (comp.lang.perl.misc)
  • vbscript WshShell.exec call in ASP
    ... I have upgraded the WSH on the server to version 5.6 and am no ... My code is very simple - I'm just trying to get a simple exec call working ... No matter what command I ...
    (microsoft.public.inetserver.iis.activeserverpages)
  • Re: Error in exec function in php
    ... this command through exec ... When php runs on a server, ... make this run by making the path to the command explicit: ...
    (comp.lang.php)
  • Re: New to this tcl lark... Why wont the exec do what I want?
    ... The whole [exec] command is in braces, ... $server goes into the exec string LITERALLY, ... DOULOS - Developing Design Know-how ...
    (comp.lang.tcl)
  • Re: dcdiag - advertising errors on newley promoted domain controller
    ... Can you do the following on uksccmads01 ... The problem may actually have nothing to do with the new server but the ... From a command prompt try and see if you get any additional info ... Skipping site UK-CCM, this site is outside the scope ...
    (microsoft.public.windows.server.active_directory)