a keby ste vy spravili nejaky narychlo projekt vo MS visual studio 2010 a hodili ho sem a ja len skopnem kod?
Příspěvky odeslané z IP adresy 87.197.156.–
Tom
Tom
#43 z_moravec
no nechal som len toto. ale ked spravim build zapnem aplikaciu kliknem na tlacitko aby spustilo odkaz tak naskoci toto http://imageshack.us/photo/my-images/196/beznzvuvv.jpg/
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call runAS("notepad.exe")
End Sub
Tom
#22 liborb
Private Sub PictureBox2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)
Call runAS("notepad.exe")
End Sub
Sub runAS(ByVal param As String)
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 Sub
Tom
#4 liborb
no jeden mi poslal tento skript ale v ultimate mi to nejako nechce ist tak preto piem ci nieje ina moznost bez cesty
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 Sub
Tom
potreboval by som skript ktory by spustil po kliknuti na tlacitko odkaz na exe subor ale v tom skripte nesmie byt cesta k odkazu odkaz bude priamo pri tej aplikacii a tych tlacitiek bude 5 a kazde tlacitko bude spustat iny odkaz na iny EXE subor