Hi Guys,
I've been searching for a few days and did not find anything that can help me.
I have a small and simple script that lists all executable s in a directory, my problem is to get them to run.
The main challenge is that the directory is dynamic (the number of apps varies).
Right now I have to see if there are any changes in the folder and fix the WHILE section to reflect the correct numbers of apps.
Thanks for you time.
I've been searching for a few days and did not find anything that can help me.
I have a small and simple script that lists all executable s in a directory, my problem is to get them to run.
The main challenge is that the directory is dynamic (the number of apps varies).
Right now I have to see if there are any changes in the folder and fix the WHILE section to reflect the correct numbers of apps.
Thanks for you time.
[ autoit ]
#include <Array.au3> #include <RecFileListToArray.au3> Opt("TrayMenuMode", 3) Global $Path = @ProgramFilesDir & "\ITAM - Report" Global $aArray = _RecFileListToArray($Path, "*.exe", 1) Global $Total = _ArrayMax($aArray) For $i = 1 To $Total TrayCreateItem($i & '- ' & StringTrimRight($aArray[$i], 4)) Next TrayCreateItem("") $Quit = TrayCreateItem("Exit") TraySetState(4) TrayTip("ITAM - Quick launch", "You can access the tools by clicking on this icon", 5, 1) TraySetState(16) TraySetToolTip('ITAM - Quick launch') While 1 $Msg = TrayGetMsg() Select Case $Msg = 7 Run('"' & $Path & '\' & $aArray[1] & '"', @ScriptDir, @SW_SHOW) Case $Msg = 8 Run('"' & $Path & '\' & $aArray[2] & '"', @ScriptDir, @SW_SHOW) Case $Msg = 9 Run('"' & $Path & '\' & $aArray[3] & '"', @ScriptDir, @SW_SHOW) Case $Msg = 10 Run('"' & $Path & '\' & $aArray[4] & '"', @ScriptDir, @SW_SHOW) Case $Msg = 11 Run('"' & $Path & '\' & $aArray[5] & '"', @ScriptDir, @SW_SHOW) Case $Msg = 12 Run('"' & $Path & '\' & $aArray[6] & '"', @ScriptDir, @SW_SHOW) Case $Msg = 13 Run('"' & $Path & '\' & $aArray[7] & '"', @ScriptDir, @SW_SHOW) Case $Msg = 14 Run('"' & $Path & '\' & $aArray[8] & '"', @ScriptDir, @SW_SHOW) Case $Msg = $Quit Exit 0 EndSelect WEnd