Re: wshShell.Run - permission denied

From: Will Chung (chungw74_at_hotmail.com)
Date: 09/13/04


Date: Mon, 13 Sep 2004 01:21:14 -0700


    I recommend that you check the permissions on cscript.exe and
cmd.exe to ensure that the IUSR_CPUNAME and IWAM_CPUNAME accounts have
read and execute permissions.

   Another thing to try is running a different program like:

<%
dim WshShell, retCode

Set WshShell = Server.CreateObject("WScript.Shell")

retCode=WshShell.Run ("cmd /c echo hi > c:\temp\test.txt" , 0, TRUE)

response.write "Return Code: " & retCode
%>

 If you are using cscript to run the vbs code then the IUSR_ account
should have at least read and execute permissions to the CSCRIPT.exe
program. In the above example, I'm using cmd.exe to echo information
into a text file in the c:\temp\ directory. In the above example,
you'll need to allow the IUSR read and execute on cmd.exe and write
permissions to the C:\temp directory.

  If an IIS lockdown script was run on your server, then many files and
folders may have explicit deny permissions to the IUSR and IWAM
accounts. This is to help secure the server from cyber attacks.

    Note that by giving permissions to execute certain programs like
cmd.exe and cscript.exe to the IUSR account, you are in effect allowing
anonymous users to execute programs on your server via the ASP scripts.

  You must therefore maintain control of write permissions to your
wwwroot directory to prevent unauthorized users/hackers from uploading
unauthorized ASP scripts onto the server and running whatever they want
on it.

   Hope this helps.

              -Will

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: sa privileges and roles
    ... permissions of that account. ... Another option is to create a dbo-owned user proc in an sa-owned user ... in your user database and grant execute permissions only on your user proc. ... SQL Server MVP ...
    (microsoft.public.sqlserver.programming)
  • Re: Problem with Performance Monitor Alerts and "Run As" command
    ... If it runs as an admin then there must be a permissions problem. ... First check that the account has read and execute permissions to the ... script that you are running, and also that BATCH has permissions to ... When creating the Performance Alert and this user is put into Administrators ...
    (microsoft.public.windows.server.general)
  • Re: Need for default umask
    ... permissions would presumably be expected to do something like: ... instance, if you're saving a script from a text editor, you'd like it to ... but it's unlikely that you would need to turn ON execute permissions as ...
    (comp.unix.internals)
  • app role has exec permission but still cant execute sp
    ... I've set up an application role in my SQL2K database as ... well as some users with no permissions. ... (including execute permissions) ... when I try to execute a stored procedure through ...
    (microsoft.public.sqlserver.security)
  • Re: File Sharing (again - sorry, Pd)
    ... InTerminal, type umask. ... Back in the good old days, Mac OS X user accounts ... The reason that the file permissions are "resetting" each time the ... that folder inherit the ACLs from the folder. ...
    (uk.comp.sys.mac)