FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TReg32 - Vista elevation
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
TReg32 - Vista elevation
Posted: Wed May 28, 2008 11:26 AM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TReg32 - Vista elevation
Posted: Thu May 29, 2008 06:42 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
TReg32 - Vista elevation
Posted: Thu May 29, 2008 10:18 PM

I've solved it creating a .reg file and shellexecuting it.

Thank you anyway.
Davide

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TReg32 - Vista elevation
Posted: Fri May 30, 2008 10:09 AM

Davide,

Would you mind to show the reg file contents ? Or a sample ? Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 190
Joined: Tue Mar 14, 2006 01:59 AM
TReg32 - Vista elevation
Posted: Sat May 31, 2008 12:10 AM
It's as simple as creating a text file like:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName]
"ComputerName"="WKS005"

I suggest you using a different reg key for testing (really changing the computer name might not be desirable), then:
ShellExecute(0,"open","regedit","/s myfile.reg","",1)

You could even shellexecute directly the reg file, but then regedit would popup a lot of confirmations.

Regards,
Davide
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
TReg32 - Vista elevation
Posted: Sat May 31, 2008 10:05 PM

Davide,

Thanks! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion