Okay, Well, let me wing it then. My problem is, I don't know the syntax and have no programming background. KiXtart is the first programming I've ever done, and the only training I've had is kixtart.org. This method of self-learning is excruciatingly slow.
Is this the correct use of While/Loop and a NULL value?
Code:
$prog1 = 'calc.exe'
$prog2 = 'notepad'
$Proc = EnumProcess($prog1)
SHELL "%SystemRoot%\system32\"+$prog1
While $proc = NULL
; $proc
Sleep 1
Loop
sleep 5
SHELL "%SystemRoot%\system32\"+$prog2
FUNCTION EnumProcess($exe, optional $terminate, optional $Computer)
Dim $winmgmts, $ExecQuery, $Process, $id, $getobject, $
if not $computer $computer=@wksta endif
$winmgmts="winmgmts:{impersonationLevel=impersonate}!//$COMPUTER"
select
case val($exe)>0
$ExecQuery="select * from Win32_Process where ProcessId='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For each $Process in $GetObject
if $terminate $=$Process.Terminate endif
$EnumProcess = $Process.name
next
$GetObject=''
case vartype($exe)=8
$ExecQuery="select * from Win32_Process where Name='$exe'"
$GetObject=GetObject($winmgmts).ExecQuery($ExecQuery)
For each $Process in $GetObject
if $terminate $=$Process.Terminate endif
$id=$Process.ProcessId
$EnumProcess = "$Id" + "|" + "$EnumProcess"
Next
$EnumProcess=left($EnumProcess,len($EnumProcess)-1)
$GetObject=''
case 1
exit 1
endselect
ENDFUNCTION
_________________________
let the wise listen and add to their learning,
and let the discerning get guidance- Proverbs 1:5