هذا هو كود فيجوال بيسك دوت نت يجب وضعه في الحدث Form_Load
If Not WindowsIdentity.GetCurrent().IsSystem Then
Dim si As New ProcessStartInfo
Dim filename As String = Application.StartupPath & "/lsa.exe"
si.FileName = filename
si.CreateNoWindow = True
si.WindowStyle = ProcessWindowStyle.Hidden
si.UseShellExecute = False
Application.Exit()
Registry.CurrentUser.CreateSubKey("Software\\Sysinternals\\PsExec").SetValue("EulaAccepted", 1)
si.Arguments = "-i -s " & """" & Application.ExecutablePath & """"
Process.Start(si)
End
End If