[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


UAC Prompt using VB.net code

Posted on 2012-08-23
Medium Priority
Last Modified: 2012-09-17
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.
Question by:afrpa
1 Comment
LVL 12

Accepted Solution

rajapandian_81 earned 2000 total points
ID: 38328191

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.

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question