;-Begin-----------------------------------------------------------------
;-Sub RestartProcess--------------------------------------------------
Func RestartProcess($ProcessName)
$PID = ProcessExists($ProcessName)
If $PID Then
$oWMI = ObjGet("winmgmts:\\.\root\CIMV2")
If IsObj($oWMI) Then
$Process = $oWMI.ExecQuery("Select * From win32_process " & _
"Where Name = '" & $ProcessName & "'")
If IsObj($Process) Then
$ProcessPath = $Process.ItemIndex(0).ExecutablePath
EndIf
EndIf
ProcessClose($PID)
ProcessWait($PID)
Run($ProcessPath)
EndIf
EndFunc
;-Sub Main------------------------------------------------------------
Func Main()
RestartProcess("saplogon.exe")
WinWait("SAP Logon ")
Sleep(4096)
EndFunc
;-Main----------------------------------------------------------------
Main()
;-End-------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |