Solved

Hkey_Current_User user not updating/ed with Hkey_User

Posted on 2008-06-09
8
551 Views
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.
0
Comment
Question by:pamarra
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 88

Expert Comment

by:rindi
ID: 21744520
Disable UAC inthe user management of Vista.
0
 

Author Comment

by:pamarra
ID: 21744585
Disabling UAC is not an option for security reasons.
0
 
LVL 5

Expert Comment

by:virtuatech
ID: 21744637
You need to find out the user's SID.   Use PStools psgetsid (http://technet.microsoft.com/en-us/sysinternals/bb897417.aspx).  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:
S-1-5-21-1229272821-117609710-725345543-500
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 88

Expert Comment

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

Author Comment

by:pamarra
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.

   
0
 
LVL 5

Accepted Solution

by:
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.
0
 

Author Comment

by:pamarra
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! :)  
0
 

Author Closing Comment

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The main issue when installing Vista and XP in dual boot is when you have to reinstall any of the two when something fails, let's say a hard disk failure, a lost partition, virus, etc. What commonly happens is that you lose all your hard work config…
There are many reasons a PC runs slower than when it was new, ranging from malicious software intended to mess things up to simple general Windows use.  Your PC performance may slowly degrade over time without you noticing but when you buy a PC from…
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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

718 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