#161212 - 2006-04-26 11:50 PM
Re: How to order the startup of programs after login
|
thepip3r
Hey THIS is FUN
   
Registered: 2005-03-02
Posts: 350
|
I don't know how reliable this function is as I haven't used it and it seems to rely on quite a few dependencies:
http://www.kixtart.org/ubbthreads/showflat.php?Cat=0&Number=82419&an=0&page=24#82419
if this doesn't work for you... you can also download a tool called PSLIST.exe if you don't already have it which lists all process running on a machine and you can call it using RUN or SHELL and then couple that with WSHPIPE() to get the results from the command into an array and then check for the existence of your process....
btw, WSHPIPE() is something i live by... love it. =D
|
|
Top
|
|
|
|
#161213 - 2006-04-26 11:51 PM
Re: How to order the startup of programs after login
|
thepip3r
Hey THIS is FUN
   
Registered: 2005-03-02
Posts: 350
|
|
|
Top
|
|
|
|
#161217 - 2006-04-27 12:12 AM
Re: How to order the startup of programs after login
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
You could even do it this way... Code:
CLS BREAK ON For $i=1 to 4 $i RUN $location+'\'+$i+'.lnk' NEXT get $
HTH,
Kent
|
|
Top
|
|
|
|
#161221 - 2006-04-27 07:31 AM
Re: How to order the startup of programs after login
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
But, Les is correct in the sense that you can do a START /WAIT for the execution of the program to complete before going on to the next program..
Kent
|
|
Top
|
|
|
|
#161226 - 2006-04-28 12:08 AM
Re: How to order the startup of programs after login
|
thepip3r
Hey THIS is FUN
   
Registered: 2005-03-02
Posts: 350
|
Well as long as your vehicles are running full blown Windows, I don't see a problem with them being in a police car but that's a pretty cool setup I must say. =P Your pseudo code (IMO) should look like this:
Code:
$prog1 = 'exe1' $prog2 = 'exe2'
SHELL "%path_to_exe1%\"+$prog1
While @ERROR <> 0 EnumProc($prog1) Sleep 1 Loop
;; Now you may want to set a sleep offset depending on ;; whether the condition exists where the program, even ;; though it may be started, needs to wait a few secs ;; before kicking off the other...
SHELL "%path_to_exe2%\"+$prog2
Function EnumProc($exe) Dim $winmgmts, $ExecQuery, $Proc, $ID, $GetObject $winmgmts = "winmgmts:{impersonationLevel=impersonate}!//" + @wksta $ExecQuery = "select * from Win32_Process where Name='" + "$exe'" $GetObject = GetObject($winmgmts).ExecQuery($ExecQuery) For Each $Proc in $GetObject $ID = $Proc.ProcessID $EnumProc = $ID + "|" + $EnumProc Next $EnumProc = Left($EnumProc,Len($EnumProc)-1) $GetObject = '' EndFunction
of course you'll probably want to add some more error checking in there but that's at least how i'd structure the nuts and bolts. gurus, please make sure i'm not telling this man's car-computers directions to McDonalds. =P
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 580 anonymous users online.
|
|
|