Search This Blog

Tuesday, May 3, 2016

Auto Elevate DotNet Applications

Below code will check if the dotnet application is started as administartor. if not then it will auto elevate the application

processinfo = New ProcessStartInfo(Assembly.GetEntryAssembly().CodeBase)
            processinfo.UseShellExecute = True
            processinfo.Verb = "runas"
            Process.Start(processinfo)
            Application.Exit()

No comments:

Post a Comment