Re: vbscript WshShell.exec call in ASP
From: sticky (sticky_at_hotmail.com)
Date: 04/05/04
- Previous message: sticky: "vbscript WshShell.exec call in ASP"
- In reply to: sticky: "vbscript WshShell.exec call in ASP"
- Next in thread: Bonj: "Re: vbscript WshShell.exec call in ASP"
- Reply: Bonj: "Re: vbscript WshShell.exec call in ASP"
- Messages sorted by: [ date ] [ thread ]
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?
>
>
- Previous message: sticky: "vbscript WshShell.exec call in ASP"
- In reply to: sticky: "vbscript WshShell.exec call in ASP"
- Next in thread: Bonj: "Re: vbscript WshShell.exec call in ASP"
- Reply: Bonj: "Re: vbscript WshShell.exec call in ASP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|