Hkey_Current_User user not updating/ed with Hkey_User

Posted on 2008-06-09
Last Modified: 2010-04-21
I am trying to run a script to apply registry settings prior to runnig a job. One of the setting I'm applying is to uncheck "Hide Extentions for All Known File Types" in Explorer. The doc I've seen pointed me to the  "HideFileExt" value in Hkey_Current_User stating that any changes to the registry here would immediatly be updated to the current user in Hkey_Users (and visa versa).

I found that running the script doesn't work. Upon further investigation I found that changing the key in "regedit" for the Hkey_Current_User did not update the user in Hkey_Users and did not update the settiing in explorer. Updating the setting from  Folder Options in Explorer updates the user in Hkey_Users but not Hkey_Current_User.  Updating the user in Hkey_Users updates the setting in Explorer, but not HKey_Current_User.
Question by:pamarra
  • 4
  • 2
  • 2
LVL 88

Expert Comment

ID: 21744520
Disable UAC inthe user management of Vista.

Author Comment

ID: 21744585
Disabling UAC is not an option for security reasons.

Expert Comment

ID: 21744637
You need to find out the user's SID.   Use PStools psgetsid (  Once you have that, you can go to the computer's HKEY_USERS key and find the user there.

psgetsid useraccountname

output should be something like:

SID for COMPUTER\administrator:
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

LVL 88

Expert Comment

ID: 21744754
Then you have to use the run as administrator option.

Author Comment

ID: 21745962
Thanks Rindi and virtuateh for the input. it helps me understand my issue a l little better. There are two accounts in HKey_Users. Both have the same SID one ending in 500 (the hidden administer I think) and the other ending in 1000. My script needs to "Run as Administer" on the user account. When the the script runs, the Hidden adinistrator user gets updated when the Hkey_Current_User is updated. ( I'm thinking because I'm running as administrator) when the job ends I'm back in my standard user.  When I turn off UAC, and run a reg add to update HideFileExt in command prompt (NOT using "Run as administrator) it works. Is there a way to run a script as administrator  and then drop the admin privilages to point to the standard user or run a script that calls a job to run as admnistrator and another to run as standard user, my goal being to run a single job that performs all my tasks.


Accepted Solution

virtuatech earned 250 total points
ID: 21746474
I'm not sure what script you're using, but in command prompt it's:
runas /user:domain\useraccount "regedit.exe"
Though it requires password input after that is executed.  Well, here's an idea: if you're using vbscript, you can do:
runas /user:administrator "cscript myscript.vbs"

Hope that helps.

Author Comment

ID: 21797005
My script is actually a batch job. my final solution was to create 2 batch jobs. Run from the standard user comand prompt, the first job performs all the processes that need to be applied to the current user. It then calls the 2nd batch using the runas (administrator) command. I'm asked for the Administrator password and all my processes needing administrator priviliages are performed.  Thanks virtuatech, and enjoy the points! :)  

Author Closing Comment

ID: 31465454
Thanks for the help. I've posted a comment explaining how I utilized your solution.

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sharing a printer 7 610
Windows permissions error 17 447
ERD won't apply changes 6 79
Best practices power settings GPO Win 10 4 95
Hi All Just a quick one for everybody. I was recently looking into setting the default User Account Picture for all my vista clients within the network but on closer inspection the group policy setting only allows you to set the default pictur…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now