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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting started with Vista/Win7 UAC

Status
Not open for further replies.

Griffyn

Programmer
Jul 11, 2002
1,077
AU
Hi,

I've resisted for a long time, but laptops with Windows 7 have started trickling into my company, and my code must work with them. Most does of course, but I need some help.

The actual project I'm working on adds a route to the IPv4 Route Table after the user has made a VPN connection. In WinXP, this was no problem, as I just used WinExec to call the "ROUTE ADD..." command. Under Windows 7, this fails because "The requested operation requires elevation".

I can get past this by having the shortcut for my program flagged to run as the administrator, but then this prompts the UAC window asking for confirmation every time the shortcut is run. I could lower the UAC settings, but I would prefer to work with them at this point.

My options:
[ul][li]Find a way to add to the IPv4 Route Table another way that doesn't trip the UAC[/li]
[li]Find a way to have my program run as the administrator, in a way that doesn't trip the UAC[/li][/ul]

Can anyone give me some help?
 
Wanted to add: I'm using Delphi 6, do the later versions of Delphi, eg. Delphi XE have built-in handling for what I'm trying to do?
 
Here's something that might help:


Something else that might be interesting, too, on the topic of Vista stuff:

Disclaimer: Usually when I post things like links and code samples, it's because I have an interest in the topic and can verify it. I have interest in this, but can't verify it (though the first is a CodeGear programmer, so I would hope they are correct) since I don't have access to Vista or 7 at the moment. Point is, it would be great to have a good sample of what to do and what to expect if at all possible!

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top