UAC Prompt using VB.net code

I am writing a program in vb.net 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.
afrpaAsked:
Who is Participating?
 
rajapandian_81Commented:
Hi,

Try anyone of the following steps:

1) You can add manifest file for psexec.exe and set requestedExecutionLevel as requireAdministrator.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb756929.aspx
2) In cmd.exe pass parameter as runas \administrator.
http://www.advancedinstaller.com/forums/viewtopic.php?f=2&t=9993
3) Update registry.
http://www.sevenforums.com/tutorials/316-compatibility-mode.html
0
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.