trof Posted February 12, 2016 Share Posted February 12, 2016 (edited) Hi, I need to convert this batch script to Autoit script FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\FDisc.txt SET DiscoF=%%i: FOR %%m IN (%DiscoF%\Documenti\Download\HONEYVIEW-PORTABLE\*.exe) DO SET INST=%%m start /wait %INST% I know how translate %DiscoF% variable I use this code (thanks to the Developer guinness) Local $aSplit = StringSplit('D E F G H I J K L M N O P Q R S T U V W X Y Z', ' '), _ $sDrive = '', _ For $i = 1 To $aSplit[0] If FileExists($aSplit[$i] & ':\FDisc.txt') Then $sDrive = $aSplit[$i] & ':\' but I don't know how translate %INST% variable Edited February 12, 2016 by trof Link to comment Share on other sites More sharing options...
Trong Posted February 12, 2016 Share Posted February 12, 2016 (edited) #include <File.au3> Local $aSplit = StringSplit('DEFGHIJKLMNOPQRSTUVWXYZ', ''), $sDrive, $sFileList For $i = 1 To $aSplit[0] If FileExists($aSplit[$i] & ':\FDisc.txt') Then $sDrive = $aSplit[$i] & ':\' ConsoleWrite("! Found: " & $sDrive & @CRLF) $sFileList = _FileListToArray($sDrive & '\Documenti\Download\HONEYVIEW-PORTABLE', '*.exe', 1, 1) For $x = 1 To UBound($sFileList) - 1 ConsoleWrite("! Execute: " & $sFileList[$x] & @CRLF) RunWait($sFileList[$x]) Next ;ExitLoop EndIf Next Edited February 12, 2016 by Trong Regards, Link to comment Share on other sites More sharing options...
jdelaney Posted February 12, 2016 Share Posted February 12, 2016 (edited) Slight modification: #include <File.au3> $a = DriveGetDrive("All") For $i = 1 To UBound($a)-1 If FileExists($a[$i] & '\FDisc.txt') Then $sFileList = _FileListToArray($a[$i] & '\Documenti\Download\HONEYVIEW-PORTABLE', '*.exe', 1, 1) For $x = 1 To UBound($sFileList) - 1 RunWait($sFileList[$x]) Next EndIf Next Edited February 12, 2016 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
trof Posted February 12, 2016 Author Share Posted February 12, 2016 Thank you very much Trong and jdelaney A complex script, compliments Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now