THEOWEB.DEV

WhatsappBot, BrowserAutomation, TelegramBot, JabberBot, IBankingBot, custom software developer, internet marketing

Run Another Program With Administrator Privileges .NET

Run Another Program With Administrator Privileges .NET

You can run another application from your application by using :
procExecuting = Process.Start(TPC.exe)

After that you could write a general method that you could use for different .exe files that you want to use. It would be like below.

Sample code :

Dim appPath As String = Application.StartupPath()
Dim procStartInfo As New ProcessStartInfo
Dim procExecuting As New Process

With procStartInfo
    .UseShellExecute = True
    .WorkingDirectory = appPath & "\"
    .FileName = "TPC.exe"
    .WindowStyle = ProcessWindowStyle.Normal
    .Verb = "runas"
End With

procExecuting = Process.Start(procStartInfo)

Run Another Program With Administrator Privileges .NET

Posting Komentar

Protected By Copyscape