Solved

Hkey_Current_User user not updating/ed with Hkey_User

Posted on 2008-06-09
8
539 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
  • 4
  • 2
  • 2
8 Comments
 
LVL 87

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
 
LVL 87

Expert Comment

by:rindi
ID: 21744754
Then you have to use the run as administrator option.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

So who is this article for? If you are like most of the computer users out there, you probably only realize the meaning of 'System maintenance' after something goes wrong. This article is for you if you care about keeping your system working opti…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

759 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

21 Experts available now in Live!

Get 1:1 Help Now