Thanks to Richard H. for a better solution to the loop then I originally had.

Okay here is a version that should get you started.
It will gather a list of all the .INI files in a given folder and then present them on screen for the user to make a choice.

This current code was tested using a folder named C:\CONTROL
Which had 14 .INI files in the folder.

AdminSetup.ini
Baltimore.ini
Chicago.ini
Dallas.ini
Glendale.ini
HongKong.ini
Hotel.ini
Leatherhead.ini
London.ini
LosAngeles.ini
Montreal.ini
Paris.ini
Tokyo.ini
WorkShop.ini


Here is an example of the output.

    Which configuraton file do you want to use?
      1. AdminSetup
      2. Baltimore
      3. Chicago
      4. Dallas
      5. Glendale
      6. HongKong
      7. Hotel
      8. Leatherhead
      9. London
    10. LosAngeles
    11. Montreal
    12. Paris
    13. Tokyo
    14. WorkShop

Enter a number between 1 and 14, or '99' to quit: 8
You chose the configuration file Leatherhead
 
Please let us know if this script works okay for you or if you were wanting something else.
 



Break On
Dim $SO,$Pause
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')


Dim $iIndex,$iAnswer,$sAnswer,$Choices
$Choices = Split(ChangeSettings('C:\CONTROL','*.ini'),'*')
$iAnswer=0
While Not $iAnswer
CLS "Which configuraton file do you want to use?"+@CRLF
For $iIndex = 1 To Ubound($Choices)+1
Right(" "+$iIndex,3)+". "+$Choices[$iIndex-1]+@CRLF
Next
$iIndex=$iIndex-1
@CRLF+"Enter a number between 1 and "+$iIndex+", or '99' to quit: "
GetS $sAnswer
$iAnswer=CInt($sAnswer)
If $iAnswer=99 Or ($iAnswer>0 And $iAnswer<=$iIndex)
; Valid response
Else
$iAnswer=0
Beep
Color r+/n "Invalid response - try again!" Color w/n @CRLF Sleep 2
EndIf
Loop


If $iAnswer=99
"Ok, No choice made, exiting now..."+@CRLF
Quit 0
EndIf


; Process the answer here...
"You chose the configuration file "+$Choices[$iAnswer-1]+@CRLF


Function ChangeSettings($Folder,$Type)
Dim $File
$File = Dir($Folder+'\'+$Type)
While Not @ERROR
If Not (GetFileAttr($File) & 16)
$ChangeSettings = $ChangeSettings+'*'+Left($File,-4)
EndIf
$File = Dir()
Loop
$ChangeSettings=SubStr($ChangeSettings,2)
EndFunction


 


Edited by NTDOC (2005-05-13 11:44 PM)