views:

132

answers:

1

I am starting an application (EXE) through Installer( MSI). While installing the MSI in Vista, it automatically run with Administrator rights (after thorough UAC). Hence the application started also runs under system user. I want this application to run Under Current User instead. In order to run application in current user I need to explicitly double click the exe. But I want it to be done programmatically. So far, the only way out is to use Process.start() using username/password. For this I need to prompt user and take password from him, which I dont want.

Can we run an exe under current user programmatically (Vista)?

Regards Sumeet

+1  A: 

If the installer, which spawns the program, is running under a user, for that program, "Current user" is that user, ie. Administrator in your case.

You will have to explicitly escape out to a different user context, and unfortunately this involves getting the user to specify his password (at the very least). Otherwise you could have programs impersonating users all willy-nilly.

Lasse V. Karlsen