In my VB-NET application I need to run a batch file as administrator.
So far I use this code but can't remember how to use runas
:
process.start("filelocation.bat")
Any help is apreciated.
Try
Dim procInfo As New ProcessStartInfo()
procInfo.UseShellExecute = True
procInfo.FileName = (FileLocation)
procInfo.WorkingDirectory = ""
procInfo.Verb = "runas"
Process.Start(procInfo)
Catch ex As Exception
MessageBox.Show(ex.Message.ToString())
End Try