Unless you can use logInAsCurrentUser option with the client, there is no way around it. The Windows API is calling the process with those arguments. When you open the client and typing it in manually, you are communicating directly with the process.
Login as current user info:
Using the Log In as Current User Feature Available with Windows-Based Horizon Client