Re: vbscript WshShell.exec call in ASP

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


Date: Tue, 6 Apr 2004 10:12:23 +1200

Typical. Spend all day yesterday trying to figure this out then in
frustration post to the newsgroup... then figure out the answer ten minutes
later!

I was making two assumptions that turned out to be incorrect and were
causing me grief:

1. The asp process would be excuting in the same directory as the source
.asp pages - it's not, it's executing in %systemroot%\system32... so you
need to explicitly define the path.
2. Standard cmd prompt commands like 'dir' would just work - they don't!
Haven't sussed out how to make them work yet. Might just use a batch file
instead.

Anyway, thanks for reading :-)

"sticky" <sticky@hotmail.com> wrote in message
news:407188d7$1@news.maxnet.co.nz...
> 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: vbscript WshShell.exec call in ASP
    ... The asp process would be excuting in the same directory as the source ... > Option Explicit ... No matter what command ... > try to exec, I get the error. ...
    (microsoft.public.inetserver.iis.activeserverpages)
  • Re: wScript.Shell Problems
    ... the completion of the underlying process. ... However, the Exec procedure is ... Here is why i went to the RUN command, it is my understanding that the ... EXEC command does not allow for the BOOLEAN indicating wether the ...
    (microsoft.public.scripting.vbscript)
  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... Are you using Tcl's glob command to do this? ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... i can call a c program and compile it? ...
    (comp.lang.tcl)
  • Re: xp_cmdshell default path (system32) problem
    ... exec xp_cmdshell @cmd1 ... - specify the full path in the del command ... ensure that xp_cmdshell ALWAYS executes under the security context of ... I haven't executed the actual erase statements yet but rather have been ...
    (microsoft.public.sqlserver.programming)
  • Re: Literal pipes in [open "|cmd..."]
    ... If it's not an [exec] directive, ... away with the intermediary pipe directives entirely also (or more ... As for a new command with a clean syntax, the only way you're going to ... fileevent $ou write $arg ...
    (comp.lang.tcl)