Hello guys,
I need to change some registry values which requires Admin rights on Vista.
Do you know some API I can call to request such elevation when I need it instead of asking the user to run my program "As Admin" ?
Thank you,
Davide
TReg32 - Vista elevation
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Davide,
Some useful links:
http://www.pluralsight.com/wiki/default ... rUser.html
http://delphi.about.com/od/delphitips20 ... _admin.htm
Some useful links:
http://www.pluralsight.com/wiki/default ... rUser.html
http://delphi.about.com/od/delphitips20 ... _admin.htm
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
It's as simple as creating a text file like:
I suggest you using a different reg key for testing (really changing the computer name might not be desirable), then:
You could even shellexecute directly the reg file, but then regedit would popup a lot of confirmations.
Regards,
Davide
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName]
"ComputerName"="WKS005"
Code: Select all
ShellExecute(0,"open","regedit","/s myfile.reg","",1)
Regards,
Davide
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: