scooper Posted August 4, 2009 Share Posted August 4, 2009 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 More sharing options...
Info Posted August 4, 2009 Share Posted August 4, 2009 The running AutoIt process is .exe. While 1 If ProcessExists("autoitprocess.exe") = 0 Then ShellExecute("autoitfile.exe") WEnd Link to comment Share on other sites More sharing options...
scooper Posted August 4, 2009 Author Share Posted August 4, 2009 (edited) Thank you Info for your answer, so there is no way to control(like the function _singleton), with another script, if an .au3 is already working? Edited August 4, 2009 by scooper Link to comment Share on other sites More sharing options...
somdcomputerguy Posted August 4, 2009 Share Posted August 4, 2009 Have the first script create a dummy text file while it's running, and also have it delete it before exitting. Have the second script check (FileExists) if or not the file exists.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
wolf9228 Posted August 4, 2009 Share Posted August 4, 2009 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 expandcollapse popupexample("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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now