Again, you HAVE to do this with elevated privledges. You simply can't make an API call and make it happen. ShellExecuteEx has a provision for requesting elevated privledge. The user will be prompted to authorize the elevation.
The other way is to use a Setup.exe. Windows 7 will automatically request elevated privledge.
>Thanks for the quick reply.
>
>My app is a VFP app launcher that looks for locally installed components such as classlibs, fxp's, etc and updates as needed and then runs the main executable. One can debate the pros and cons of the technique, but it has worked well for years under XP and 2000. I also check for some COM objects used by several of my apps and if they aren't present, copy them locally and register them.
>
>Do you know how to do this programmatically in VFP under Win 7? With Shell or API calls or...?
>
>Thanks,
>
>Gary
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer