?
Solved

Hkey_Current_User user not updating/ed with Hkey_User

Posted on 2008-06-09
8
Medium Priority
?
554 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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 750 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

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…
The Service applet starts in Extended Mode by Default, with a taskpad on the left of the services pane. This view mode was introduced in XP. As I find it not very usefull, I like to use the Standard view as default, and without the Console tree. …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

771 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