#36307 - 2003-02-11 09:07 PM
Re: Checking for a running process, execute if not running
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
break on
:top if not findproc("iexplore.exe") run("c:\...\iexplore.exe") endif sleep 5 goto top [ 11. February 2003, 21:39: Message edited by: Radimus ]
|
|
Top
|
|
|
|
#36308 - 2003-02-11 09:30 PM
Re: Checking for a running process, execute if not running
|
Diane
Fresh Scripter
Registered: 2002-12-31
Posts: 22
|
Radimus, Thanks for the quick reply. I see now it was in fact your modified UDF. I tried adding your code but it still won't open a browser. Here's my current code, can you see anything wrong ?(or right..hehe). I'm sorry for the ignorance, i'm not used to UDF's
code:
break on
:top if not findproc("iexplore.exe') run "c:\program files\internet explorer\iexplore.exe" endif sleep 5 goto top
FUNCTION FindPROC($PROC,optional $COMPUTER, optional $terminate) dim $GetObject, $Select if not $computer $computer=@wksta endif $GetObject="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER" $select="select * from Win32_Process where Name='$PROC'" For each $Process in GetObject("$GetObject").ExecQuery("$select") if $terminate $Process.Terminate endif $FindPROC=$Process.ProcessId Next ENDFUNCTION
Thanks again
_________________________
----------------------------
Diane
Confucious say: Woman who keep washing liquid on top shelf, jump for joy
|
|
Top
|
|
|
|
#36309 - 2003-02-11 09:32 PM
Re: Checking for a running process, execute if not running
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
look at the typo in the: if not findproc() statement... mismatched quotes...
|
|
Top
|
|
|
|
#36313 - 2003-02-11 10:05 PM
Re: Checking for a running process, execute if not running
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
and it stars the Raiders and Buccaneers...
|
|
Top
|
|
|
|
#36314 - 2003-02-14 06:24 PM
Re: Checking for a running process, execute if not running
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
Another way to find such typo's can be find with our kixstrip tool. You can find it on the pages Home - Kix Tools or Summary of Site on our site. Also documentation is available. Our call is
kixstrip input.kix output.kix /block_check
The output is
code:
BREAK ON
:top IF NOT findproc("iexplore.exe') RUN "c:\program files\internet explorer\iexplore.exe" ENDIF SLEEP 5 GOTO top
FUNCTION FindPROC($proc,OPTIONAL $computer, OPTIONAL $terminate) DIM $getobject, $select IF NOT $computer $computer=@wksta ENDIF $getobject="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER" $select="select * from Win32_Process where Name='$PROC'" FOR EACH $process IN GetObject("$GetObject").execquery("$select") IF $terminate $process.terminate ENDIF $findproc=$process.processid NEXT ENDFUNCTION
;($begin) ; ; fri 14-feb-2003 18:25:28 (kix 4.20 vs 4.00e) ; ;Summary KIXSTRIP: block structures ; - do:until [0:0] ; - for|each:in|to:step|next [1|1:1|0:0|1] ; - function:endfunction [1:1] ; - if:else:endif [3:0:3] ; - select:case:endselect [0:0:0] ; - while:loop [0:0] ;Warning KIXSTRIP: 1 line is incompleted. ; rerun program with option "/block_check /show_errors". ;Warning KIXSTRIP: some lines contains errors or possible errors. ; 1 line incomplete "double quotation". ; 1 line incomplete "left parenthesis". ; 1 line incompleted. ;Informative KIXSTRIP: 5 block_structures found. ;Informative KIXSTRIP: 1 UDF found. ;Informative KIXSTRIP: 1 label found. ;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE ;Informative KIXSTRIP: 1 BREAK ;Informative KIXSTRIP: 1 ENDFUNCTION ;Informative KIXSTRIP: 1 FUNCTION ;Informative KIXSTRIP: 1 GOTO ;Informative KIXSTRIP: 1 RUN ;Informative KIXSTRIP: 1 SLEEP ; ;($end) ;($begin) ; ;Warning KIXSTRIP: 4 line incomplete "double quotation". ;Warning KIXSTRIP: 4 line incomplete "left parenthesis". ;Warning KIXSTRIP: 4 line incompleted. ; ;($end)
greetings.
btw: symbol on our homepage has been linked to related http://kixtart.org topic.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1119 anonymous users online.
|
|
|