Search code examples
delphirunas

Delphi Shellexcute and windows run as option


My computer is a part of company domain, I want to use the ShellApi's shellexcute function to run windows files with a given username and password (run as like), is it possible to include them in the function's parameters?


Solution

  • You can use the CreateProcessAsUser and LogonUser functions or, more directly, use the CreateProcessWithLogon function.

    By the way, all these functions are declared in the JwaWinBase unit which is part of the JEDI API Library