Sub lance() Dim p As New StreamWriter("C:\RestartReparMode.bat") p.WriteLine("@echo off") p.WriteLine("reagentc /boottore") p.WriteLine("shutdown /r") p.Close() Try Process.Start("C:\RestartReparMode.bat") Catch ex As Exception MsgBox("Logiciel introuvable ", vbExclamation, My.Application.Info.ProductName) End Try System.Threading.Thread.Sleep(500) My.Application.DoEvents() Kill ""C:\RestartReparMode.bat"" System.Threading.Thread.Sleep(500) End End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question' METTRE LA BONNE ADRESSE Try Process.Start("C:\ReAgent.exe") Catch ex As Exception MsgBox("Echec ", vbExclamation, My.Application.Info.ProductName) End Try ' ' ----- ET ----- ' Try Process.Start("C:\ReAgent.exe", "paramètres") Catch ex As Exception MsgBox("Echec ", vbExclamation, My.Application.Info.ProductName) End Try
ReAgentc /boottore
Try Process.Start("C:\ReAgentc.exe", "boottore") ' OU ??? Process.Start("C:\ReAgentc.exe", boottore) Catch ex As Exception MsgBox("Echec ", vbExclamation, My.Application.Info.ProductName) End Try
Try Process.Start("C:\Windows\System32\ReAgentc.exe", "/boottore") ' OU ??? Catch ex As Exception MsgBox("Echec ", vbExclamation, My.Application.Info.ProductName) End Try
Try Process.Start("C:\Windows\System32\ReAgentc.exe") Catch ex As Exception MsgBox("Echec ", vbExclamation, My.Application.Info.ProductName) End Try
Dim RedémarragePE As New Process With RedémarragePE.StartInfo .FileName = "cmd.exe" .Arguments = "reagentc /boottore >NUL" End With RedémarragePE.Start()
shell("c:\monfichier.bat")et en lançant le programme en mode administrateur mais ça ne marche pas.
Public Class Form1 Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _ ByVal Handle As Int32, _ ByVal lpOperation As String, _ ByVal lpFile As String, _ ByVal lpParameters As String, _ ByVal lpDirectory As String, _ ByVal nShowCmd As Int32) As Int32 Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim r As Int32 r = ShellExecute(0, "open", "http://www.microsoft.com", 0, 0, 1) End Sub End Class