Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regedit Run As?

Status
Not open for further replies.

Dillinger99

Technical User
Jun 6, 2003
125
US
Is it possible to do a regedit /S text.reg command with some sort of 'run as Administrator' switch?
 
So , you want to work in Registry from a non administrator user ?

Mohamed Farid
Know Me No Pain , No Me Know Pain !!!
 
Correct--I want to be able to run a batch script to do a regedit when a user logs in.
 
Wow, thats a thought! I may try to play with this later cause its something that I have never heard of. I know you can do the RUN AS command on a shortcut to the application, but I don't know about command lines.

Very Interesting post....!
 
Yes there is some kind of komand"s in regedit,(regedit /:l,/:r .. (I"ll find them ) but thing You want to do are avaliable with regedt32.Regedt32 is much powerfull than regedit.Let me consult my books I"ve red somewhere something about that.See You soon.
 
OK,REGEDIT FROM COMMAND LINE
1.REGEDIT [/L:system] [/R:user] file_name1 to import registry file in RegEdit
2.REGEDIT [/L:system] [/R:user] /C file_name2 to create registry object from file
3.REGEDIT [/l:system] [/r:user] /E file_name3 [regpath1] to export registry or part of registry
4.REGEDIT [/L:system] [/R:user] /D regpath2
/L:system point to place where is file system.dat
/R:user point to place where is user.dat file
file_name1 point to file or files which You importing in registry
/C file_name2 telling us which file is the file that is creating from registry
/E file_name3 det.file for export from reg.
regpath1 determ starting key in registry from where starts export (default exportig whole registry)
/D regpath2 key for delete
 
What key are you trying to modify?

Go to the command shell and type "runas /?".
However this will prompt for a password. It may be possible to use an input pipe for the password prompt through a batch file, however the admin password will have to be saved in cleartext.

If you are modifying HKCU, you shouldn't need administrator privileges.

I used to have a script that would modify HKCU to add Terminal Services shortcuts.

Daniel.
 
I'm trying to add an entry to the HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce key.

I'll try your runas /? suggestion. I don't know why I didn't think of that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top