I'm using visual basic 2013. I'm trying to make a program to run and give commands to admin cmd using vb. I wrote a code to do it using "runas". But still it says "You must run this command from a command prompt with administrator privilege." I tried setting "myprocess.StartInfo.UseShellExecute = True" also.Then it says "The Process object must have the UseShellExecute property set to false in order to redirect IO streams."
Here is my code.
Dim myprocess As New Process()
myprocess.StartInfo.FileName = "netsh"
myprocess.StartInfo.Arguments = "wlan start hostednetwork"
myprocess.StartInfo.Verb = "runas"
myprocess.StartInfo.CreateNoWindow = False
myprocess.StartInfo.UseShellExecute = False
myprocess.StartInfo.RedirectStandardOutput = True
myprocess.Start()
TextBox1.Text = (myprocess.StandardOutput.ReadToEnd())