takze na jednom fore som dostal takyto skript na spustenie odkazu na exe subor
Kód: Vybrať všetko
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
call runAs()
End Sub
Sub runAS()
Dim process As System.Diagnostics.Process = Nothing
Dim processStartInfo As System.Diagnostics.ProcessStartInfo
processStartInfo = New System.Diagnostics.ProcessStartInfo()
processStartInfo.FileName = "notepad.exe" 'program co chces spustit
If System.Environment.OSVersion.Version.Major >= 6 Then
' Run as admin on Windows Vista or higher
processStartInfo.Verb = "runas"
End If
' processStartInfo.Arguments = "args" 'arguments
processStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal
processStartInfo.UseShellExecute = True
Try
process = System.Diagnostics.Process.Start(processStartInfo)
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Finally
If Not (process Is Nothing) Then
process.Dispose()
End If
End Try
End SubKód: Vybrať všetko
Error 1 'Public Sub runAS()' has multiple definitions with identical signatures.