VBScript wont run for domain user on Windows Server 2008 R2

37,268

Solution 1

A setting in the ".DEFAULT" user's registry isn't going to affect other users, so that posting's advice is dubious to me, immediately.

Verify that "Users" have "Read" access to "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings". If they don't, then I suspect this is the cause of the problem that cscript.exe is reporting. I'm not aware of the default permission for that key being changed in Windows Server 2008 R2 being changed, though, so I'd wonder how it got changed (assuming that you find it has).

If the problem continues you may want to run "Process Monitor" against the user's attempt to execute cscript.exe to try and uncover more details.

Solution 2

I solved this problem on a windows server 2012R2 machine by creating the following key in the registry

HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script Host\Settings

And then granting full control permissions to the IIS Apppool\{AppPoolUser} user on the 'Windows Script Host' key.

Share:
37,268

Related videos on Youtube

NeerPatel
Author by

NeerPatel

Updated on September 17, 2022

Comments

  • NeerPatel
    NeerPatel over 1 year

    I've got a script that runs just fine under the administrator user. But when a domain user executes the script, we get this error message.

    CScript Error: Loading your settings failed. (Access is denied. )
    

    This error only happens on a Windows 2008 R2 Server. Which is a member of the domain. It works fine on the Windows 2003 Domain Controller. I did a google search, and found this site http://www.tek-tips.com/viewthread.cfm?qid=609886&page=457

    It said, create the following registry key. Which I did, but it didn't help.

    HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script\Settings
    

    Anyone have an idea how to get this to work?


    test.vbs :

    Wscript.echo "hello" 
    

    The run command is :

    cscript C:\FileTransfer\TEST\test.vbs
    
    • Gary Brunton
      Gary Brunton almost 9 years
      Note that instead of 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script\Settings' it should be 'HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script Host\Settings'
  • NeerPatel
    NeerPatel over 13 years
    @Evan, I couldn't find a value named "Users" in"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings" Should I create it?
  • NeerPatel
    NeerPatel over 13 years
    System\Users was enabled. I added "Domain\Domain Users". This didn't fix it. (I didn't restart the servers.. do you think it matters?)
  • Spence
    Spence over 13 years
    Rebooting wouldn't (shouldn't) make any difference. It must be something else, then. I'd probably take the route of running a Process Monitor trace next (but that's just my "go to" utility in this case).
  • NeerPatel
    NeerPatel over 13 years
    @Evan: Ok, I installed Process Monitor, and I found this error. "3:43:56.0777086 PM cscript.exe 4000 RegCreateKey HKU\.DEFAULT\Software\Micro‌​soft\Windows Script Host ACCESS DENIED Desired Access: Maximum Allowed" I added Domain\Users and it fixed the problem!! Thanks!!
  • Spence
    Spence over 13 years
    To the ".DEFAULT" hive? Insane! I need to research that. That's running as a normal domain user via Terminal Services-- right?
  • NeerPatel
    NeerPatel over 13 years
    No, its within a telnet session.
  • Gary Brunton
    Gary Brunton almost 9 years
    I can confirm that on my windows server 2012R2 I came across this problem and fixed it by creating the HKEY_USERS\.DEFAULT\Software\Microsoft\Windows Script\Settings key and updating it's permissions. It took quite some time to figure out what was going on and fix it with your guy's help.