[thelist] using wscript.shell to run commands (again)

Ken Schaefer ken at adOpenStatic.com
Mon Jun 21 17:01:05 CDT 2004


What user context is thw code running in? If the user context isn't the same
as the one you are logged on interactively as, and also does not have
"interact with the desktop" privileges on the machine, you will not see
anything.

Cheers
Ken


----- Original Message ----- 
From: "Joel D Canfield" <joel at spinhead.com>
To: <thelist at lists.evolt.org>
Sent: Tuesday, June 22, 2004 6:35 AM
Subject: [thelist] using wscript.shell to run commands (again)


I'm experimenting with wscript.shell for some automation. This code
returns no errors, but it doesn't do anything, either (I've run it on a
client, and on the web server.)

I'm expecting it to open a DOS window, change to the root directory, and
output a listing to the active window. Instead, nothing visible happens.

=================================
<%
Dim wshell, intReturn
set wshell = server.createobject("wscript.shell")
intReturn = wshell.run("%comspec% /k cd\ & dir *.*", 1, False)
Response.Write( intReturn )
set wshell = nothing
%>
<html>
<head>
<title>Testing WScript.Shell Object</title>
</head>
<body>
</body>
</html>
=================================
Thanks



More information about the thelist mailing list