INI files are OK if you are going to manually keep them up to date.

If you are going to manage them programatically then they are a pain, as the sections will not be added in any order.

To preserve the order (and guard against errors if the file is manually updated), give the section a name that can be easily sorted.

Your ini file could look like this:
Code:
[SyncStart]
Path=c:\scripts\syncstartscripts
[Recover]
Path=c:\scripts\recoverscripts
[SyncStart_001]
File=somescript.kix
NoRun=1
[SyncStart_123]
File=script123.kix
Params=$sFoo=bar
NoRun=0
[SyncStart_045]
File=script45.kix
NoRun=0
[Recover_200]
File=recsscipt.kix
[Recover_101]
File=recother.kix
NoRun=1



In which case your code would look something like this:
Code:
$sRunLevel=".\runlevel.ini"

For Each $sScript in GetScripts("SyncStart",$sRunLevel)
"Executing '"+$sScript+"'"+@CRLF
Next

Function GetScripts($sType,Optional $sFile)
Dim $sPath, $sOptions, $sSection
If Not $sFile $sFile=".\runlevel.ini" EndIf

$sPath=ReadProfileString($sFile,$sType,"Path")
If $sPath $sPath=$sPath+"\" EndIf

For Each $sSection In qs(Split(ReadProfileString($sFile,"",""),Chr(10)))
If InStr($sSection,$sType+"_")=1
If Not Int(ReadProfileString($sFile,$sSection,"NoRun"))
Redim Preserve $GetScripts[UBound($GetScripts)+1]
$GetScripts[UBound($GetScripts)]=Trim(
$sPath
+ReadProfileString($sFile,$sSection,"File")
+" "
+ReadProfileString($sFile,$sSection,"Params")
)
EndIf
EndIf
Next
EndFunction

; Use whichever sort UDF you prefer - I've borrowed this one

; BrianTX's Quicksort
function qs($a)
DIM $b[32],$c[32],$d,$e,$f,$g,$h,$i,$j,$k,$l
$b[0]=0
$c[0]=UBOUND($a)
$d=0
While $d >=0
$e=$b[$d]
$f=$c[$d]
While $e < $f
$h=$e+($f-$e)/2
$k=$a[$e]
$A[$e]=$A[$h]
$A[$h]=$k
$i=$e+1
$j=$f
$l=0
Do
While ($i<$j) AND $A[$e] > $A[$i]
$i=$i+1
Loop
While ($j>=$i) AND $A[$j] > $A[$e]
$j=$j-1
Loop
IF $i>=$j
$l=1
ELSE
$k=$A[$i]
$A[$i]=$A[$j]
$A[$j]=$k
$j=$j-1
$i=$i+1
ENDIF
Until $l=1
$k=$a[$e]
$a[$e]=$a[$j]
$a[$j]=$k
$g=$j
If $g-$e <= $f - $g
If $g+1 < $f
$b[$d]=$g+1
$c[$d]=$f
$d=$d+1
Endif
$f=$g-1
Else
If $g-1 > $e
$b[$d]=$e
$c[$d]=$g-1
$d=$d+1
Endif
$e=$g+1
Endif
Loop
$d=$d-1
Loop
$qs=$a
Endfunction



I've used qs() to order the array as I had it handy, but you can use whatever you like.

Output from the sample looks like this:
Code:
Executing 'c:\scripts\syncstartscripts\script45.kix'
Executing 'c:\scripts\syncstartscripts\script123.kix $sFoo=bar'