Re: wsh, bat, win2003, ASP

From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 02/03/05


Date: Thu, 03 Feb 2005 17:22:01 +0100

Sharon wrote:

> Hi,
> An ASP page on Win2000, IIS5, uses wsh to execute a bat file that runs an
> ldap command in cmd.exe. Works great.
> Had to move to Win2003, IIS6, and now it doesn't work.
>
> It works fine if I type it manually via the command prompt. Does not work
> through the ASP page, so I'm focused on IIS and wsh.
Hi

Most likely you need to change the ACL on CMD.EXE/CSCRIPT.EXE
/WSCRIPT.EXE.

Here is a previous post I would think is relevant from this thread:
http://groups.google.com/groups?threadm=OdKF%23L75DHA.2488%40TK2MSFTNGP09.phx.gbl

From: David Wang [Msft] (someone@online.microsoft.com)
Subject: Re: wsript.shell problem
Newsgroups: microsoft.public.windows.server.scripting
Date: 2004-01-30 20:32:47 PST

<quote>
ACLS on CSCRIPT.EXE (indeed, all of the commandline EXE in SYSTEM32) changed
on Windows Server 2003 to make it impossible for non-Administrators to
execute them when accessed via IIS. This is for security purposes. I
suspect that when running with wscript, a popup declaring "Access Denied"
happened, but since it's in another window station, you can't see it and
dismiss the dialog... so the script got stuck right there. I suspect that
when running with cscript, you are still getting "Access Denied", but this
time it's a console app, so the process just exited.

I suggest you first enable authentication, authenticate as Administrator,
and then try WshShell.Run again.

If you change ACLs, realize that you are consciously weakening your server's
security, so choose wisely.

Personally, the code you have in the VBS file can be placed in an ASP file
and parameterized, so you do not need to use WshShell.Run to run it.
</quote>

-- 
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx


Relevant Pages

  • Re: Booming or Fuming? Are You Alive? Or Are You Fading Away?!
    ... The single .cmd file which is a Command Library ... consists of ONLY scripting code using ONLY ... every detail of convoluted shell scripting command syntax. ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Booming or Fuming? Are You Alive? Or Are You Fading Away?!
    ... The single .cmd file which is a Command Library ... consists of ONLY scripting code using ONLY ... every detail of convoluted shell scripting command syntax. ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Any other words like right and left, east and west?
    ... For this speech activated scripting stuff, ... program to Dragon NaturallySpeaking called "Dragonfly". ... programs that enables Continuous Command Recognition. ...
    (alt.usage.english)
  • [COMMERCIAL] Ellié Computing Merge 2.1 for Linux
    ... You need to install the command line tools for that SCC. ... An ECMAScript compatible scripting engine is now included in ECMerge. ... Run on a differentiation, it will now export a textual ...
    (comp.os.linux.announce)
  • [ANN] Ellié Computing Merge 2.1
    ... You need to install the command line tools for that SCC. ... An ECMAScript compatible scripting engine is now included in ECMerge. ... Run on a differentiation, it will now export a textual ...
    (comp.software.shareware.announce)

Loading