Spyros Karavanis
Spyros Karavanis

Reputation: 148

Delphi run as different user

I want a way in Delphi which I can run an exe file as a different user in order to gain different permissions. I do not want elevation of permissions. Screenshot:

enter image description here

I want from delphi code to start an application as a different user as depicted in the picture.

Upvotes: 7

Views: 2642

Answers (1)

David Heffernan
David Heffernan

Reputation: 613053

The API function that you are looking for is CredUIPromptForCredentials. This returns a username and password that you can pass to CreateProcessWithLogonW.

Upvotes: 11

Related Questions