Jump to content

How to know if a script is it's working


Recommended Posts

hi all,

I try to make a script that control if another autoit script it's working, and if not it'll run it.

I tried with ProcessExists but it doesn't work because the script is .au3 and not .exe, I suppose!

Thanks for any suggestions

Link to comment
Share on other sites

hi all,

I try to make a script that control if another autoit script it's working, and if not it'll run it.

I tried with ProcessExists but it doesn't work because the script is .au3 and not .exe, I suppose!

Thanks for any suggestions

http://www.autoitscript.com/forum/index.php?showtopic=61122&st=0&p=459147&hl=Win32_ProcessStartup&fromsearch=1&#entry459147

example("AutoIt3.exe")
Func example($ProcessName)
Dim $SW_NORMAL = 1
$strComputer = "."
$objWMIService = ObjGet("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & $strComputer & "\root\cimv2")

$objStartup = $objWMIService.Get("Win32_ProcessStartup")
$objProcess = $objWMIService.Get("Win32_Process")
    $colProcessStopTrace = $objWMIService.ExecNotificationQuery _
        ("SELECT * FROM Win32_ProcessStartTrace")
        $message =  "Waiting for process " & $ProcessName & " to Start ..."
        SplashTextOn("Process", $message, 400, 70, 0, 0, 4, "")
        sleep(3000)
       SplashOff ( )
       $list = ProcessList($ProcessName)
       $TXT = ""
       For $i = 1 To $list[0][0]
        $TXT &= $list[$i][1] & @CR
       Next
       $i = 0
    Do
        $objLatestEvent = $colProcessStopTrace.NextEvent
        If Not StringInStr($TXT, $objLatestEvent.ProcessId) Then
            $message = "StartProcess Name: " _
                & $objLatestEvent.ProcessName
           SplashTextOn("Process", $message, 400, 70, 0, 0, 4, "")
           sleep(4000)
            $message = "Process ID: " & $objLatestEvent.ProcessId
           SplashTextOn("Process", $message, 400, 70, 0, 0, 4, "")
           sleep(4000)
            SplashOff ( )
        $i = 1
    EndIf
Until $i = 1
exit
EndFunc

صرح السماء كان هنا

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...