I have a windows application which when you run ,first checks if there's a new version of the application. If there is a new version it downloads the exe then tries to run it. When it tries to run the exe, if the user did not run the application as an administrator an error occurs. But if they did run it as an administrator everything works fine. Please find below the code I am using to open the exe. Am not sure what I am doing wrong. Please assist. Thank you.
Private Sub DownloadFileCompletedCallBack(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs)
Dim processStartInfo As ProcessStartInfo = New ProcessStartInfo()
processStartInfo.FileName = _tempPath
processStartInfo.Verb = "runas"
Process.Start(processStartInfo)
Close()
End Sub
The error i get is as follows System.ComponentModel.Win32Exception (0x80004005): The requested operation requires elevation at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)