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

Anthony Baratta Anthony at Baratta.com
Mon Jun 21 16:52:07 CDT 2004

At 01:35 PM 6/21/2004, Joel D Canfield wrote:
>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

Try two %% around compspec.

e.g.  %%compspec%%

Anthony Baratta
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."

More information about the thelist mailing list