1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
Imports System
Imports System.Diagnostics
Module updater
Private WithEvents ObjProcess As New Process()
Sub Main(ByVal Args As String())
Process.GetProcessById(Args(0)).Kill()
'Dim ObjProcess As New Process()
Dim cabFile As String = "\monRep\TPS.CAB"
Dim param As String = cabFile & " /nodelete /noui /silent "
Dim psi As New ProcessStartInfo("\WINDOWS\wceload.exe", param)
AddHandler ObjProcess.Exited, AddressOf ObjProcess_Exited
ObjProcess.StartInfo = psi
ObjProcess.EnableRaisingEvents = True
ObjProcess.Start()
ObjProcess.WaitForExit()
ObjProcess.Close()
'If ObjProcess.ExitCode = 0 Then
' Process.Start("/monRep/TPS.exe", "")
'End If
End Sub
Private Sub ObjProcess_Exited(ByVal sender As Object, ByVal e As System.EventArgs) Handles ObjProcess.Exited
Process.Start("/monRep/TPS.exe", "")
End Sub
End Module |
Partager