Permission denied trying to update environment variable in in Windows 7
I am trying to update an environment variable in Windows 7. I am running under an domain account that has local Administrative privileges and I get an error indicating "Permission denied" Code 800A0046. I run the same vbscript from the local Administrator account and the script runs fine. What's going on with the permissions and how do I change the permissions so the script runs.
March 15th, 2010 7:12pm

Hi, Did you log on the computer via remote connection?Please make sure your domain administrator account is in the group of your local "Administrators".If not, it may be caused by the control boundary of Domain Administrator on local machine. It has to be done under local Administrator, so as to make sure it safe to update environment variables.Read the Windows Script Error message carefully, then check the access control list to see who has permission to use the page, or use the device.http://www.computerperformance.co.uk/Logon/code/code_800A0046.htm If you want to apply the script, you need to make the script run as administrator.For your reference: http://social.technet.microsoft.com/Forums/en-US/w7itprogeneral/thread/048bf679-0fa5-4589-821f-57c276a8a1b1 Hope it helps!Since this issue is more related to scripting, I recommend you open a thread to Official Scripting Guys Forum in Technet so those coders can help you fix the issue in a timely manner.Official Scripting Guys Forum http://social.technet.microsoft.com/Forums/en/ITCG/threadsScript Center: http://technet.microsoft.com/en-us/scriptcenter/default.aspx
Free Windows Admin Tool Kit Click here and download it now
March 16th, 2010 1:07pm

Thanks Martin When I am logged in as the local administrator, the script runs fine. Yes the Domain Admins are members of the "Administrators" group. When I log in using my domain account which is not the domain administrator account but never the less a member of the "administrators" group as well, the script fails giving the permissions error. I have a batch file calling the vbs program that updates the environment variable. I used a runas command in the batch file to envoke the vbs script. I am prompted for the password for the local administrator account but I then get a msg indicating that the script is not a valid Win32 application. So using the runas from the batch file doesn't work either. I guess the next step is to include the code in the vbsscript itself to run under the local administrator account credentials.
March 16th, 2010 9:51pm

Greetings,In my opinion, certain function need to be added to the script codes.You can use Psexec to run something with different credits:http://technet.microsoft.com/en-us/sysinternals/bb897553.aspxAvait your reply.
Free Windows Admin Tool Kit Click here and download it now
March 17th, 2010 12:17pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics