So I have a WPF application and here is what I want it to do. I can right click on the executable, select Run As Different user, and get the Windows Security box with User Name and Password, as well as the Smart Card logon. I was wondering if there was a way to launch the Sysinternals Run as Different User to come up automatically, without having to right click and select Run As Different User. Any thoughts?
I was able to go into the Assembly Manifest and force it to run as administrator, but that isn't what I need. I really need the option to run it with Smart Card credentials. Thank you in advance!
AFAIK, the only way to do it that works is by using the
RunAs exe
as follows. The/savecred
will cache credentials, but your user will still have to enter it the very 1st time (which might be annoying for your use-case).or, if you're on a domain:
Example: To Run Visual Studio 2012 in Admin Mode, I tried the following and it worked. I was prompted to enter my password just once, for the 1st time.
Further Reading: Runas Documentation.