UAC Prompt using code

I am writing a program in that requires running an external program (psexec.exe).
But I need to have my program prompt for Admin credentials and then pass them through to open the psexec.exe command as the admin from UAC.
I am unable to pass the credentials using the plain Process.Start syntax due to security reasons (we don't want to pass the password that way.)
Instead of using something like the following code -
Process.Start("cmd.exe", " /k PSExec.exe \\" & computername.text & " cmd.exe"
which will call the cmd to run psexec (but needs to have it loaded as Admin).

Sorry for the confusion on the information - but short story I need a way to prompt (through my VB program) for User Account Control prompt to get an admin to input Admin credentials and then open and execute a command & psexec.

Please let me know if anyone has any advice.  Thank you.
Who is Participating?

Try anyone of the following steps:

1) You can add manifest file for psexec.exe and set requestedExecutionLevel as requireAdministrator.
2) In cmd.exe pass parameter as runas \administrator.
3) Update registry.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.