le15 Posted November 12, 2006 Posted November 12, 2006 How to make same of this command in AutoIt ?For /R "D:\MyProgramFolder\" %1 in (.) do echo %~f1 >> "TmpFile.txt"I didn't want use the TmpFile.txt so it would be better to use an ArraySomeone have idea ?
Fossil Rock Posted November 12, 2006 Posted November 12, 2006 What are you attempting to do? Agreement is not necessary - thinking for one's self is!
le15 Posted November 12, 2006 Author Posted November 12, 2006 What are you attempting to do?I am working in project WinBuiderI need to make a list of all folder in where is located an application that i want to make a pluginSee file attached
ChrisL Posted November 12, 2006 Posted November 12, 2006 How to make same of this command in AutoIt ? For /R "D:\MyProgramFolder\" %1 in (.) do echo %~f1 >> "TmpFile.txt" I didn't want use the TmpFile.txt so it would be better to use an Array Someone have idea ? Search ("d:\Kiosk", @scriptdir & "\output.txt");replace with your search directory and output file Func Search($current,$textfile) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then ;this is where you write the log FileWriteLine ($textfile,$current & "\" & $file) EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then Search($current & "\" & $file, $textfile) EndIf WEnd FileClose($search) EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
ChrisL Posted November 12, 2006 Posted November 12, 2006 or i guess you could use _FileListToArray () if you don't need it in a file see the help file for more details [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
le15 Posted November 12, 2006 Author Posted November 12, 2006 or i guess you could use _FileListToArray () if you don't need it in a file see the help file for more detailsThank you That's what i wantI have just change this line for having just the list of all folder without the filename If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then By If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") ThenI will try this _FileListToArray () if i can make it work Ihave a little more understand how to make a functionThank you
le15 Posted November 12, 2006 Author Posted November 12, 2006 or i guess you could use _FileListToArray () if you don't need it in a file see the help file for more details#Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray("E:\WB_Source\Applications\IrfanView", "*", 2) ;_FileListToArray($sPath, $sFilter = "*", $iFlag = 0) If (Not IsArray($FileList)) and (@Error=1) Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") -------------------------------------------------------------------------------------------------------------------------- >C:\Program Files\AutoIt3\SciTE\..\au3check.exe "E:\AutoIT Apps\Nouveau AutoIt v3 Script (5).au3" AutoIt3 Syntax Checker v1.54 Copyright (c) Tylo 2006 E:\AutoIT Apps\Nouveau AutoIt v3 Script (5).au3(79,19) : ERROR: _FileListToArray() called with wrong number of args. _FileListToArray () ~~~~~~~~~~~~~~~~~~^ E:\AutoIT Apps\Nouveau AutoIt v3 Script (5).au3(30,58) : REF: definition of _FileListToArray(). Func _FileListToArray($sPath, $sFilter = "*", $iFlag = 0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ E:\AutoIT Apps\Nouveau AutoIt v3 Script (5).au3 - 1 error(s), 0 warning(s) >Exit code: 2 Time: 0.207 I can't make this work Why , I get error ?
ChrisL Posted November 12, 2006 Posted November 12, 2006 What version of AutoIT are you running. I just ran this #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray("E:\WB_Source\Applications\IrfanView", "*", 2) ;_FileListToArray($sPath, $sFilter = "*", $iFlag = 0) If (Not IsArray($FileList)) and (@Error=1) Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") With no problem, I did have to change the search directory to one I actually had. Create a script with this in MsgBox (0,"",@AutoItVersion) to get the version [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
le15 Posted November 13, 2006 Author Posted November 13, 2006 What version of AutoIT are you running. I just ran this #Include <File.au3> #Include <Array.au3> $FileList = _FileListToArray("E:\WB_Source\Applications\IrfanView", "*", 2) ;_FileListToArray($sPath, $sFilter = "*", $iFlag = 0) If (Not IsArray($FileList)) and (@Error=1) Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf _ArrayDisplay($FileList,"$FileList") With no problem, I did have to change the search directory to one I actually had. Create a script with this in MsgBox (0,"",@AutoItVersion) to get the versionOk i've found the error i've _FileListToArray() in bottom that i didn't see But by this way it doesn't work like the first one It doesn't list sub folder i've try to make it work like the first but i can't
ChrisL Posted November 13, 2006 Posted November 13, 2006 Will this help? #include <array.au3> Dim $folderlist [1] Dim $fileList [1] Search ("d:\Kiosk");replace with your search directory Func Search($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then $FileList[0] = ($FileList[0] + 1) _ArrayAdd ($fileList, $current & "\" & $file) EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then $FolderList[0] = ($folderList[0] + 1) _arrayAdd ($folderList,$current & "\" & $file) Search($current & "\" & $file) EndIf WEnd FileClose($search) EndFunc _arrayDisplay ($FolderList,"Folders") _arrayDisplay ($FileList,"Files") [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
le15 Posted November 13, 2006 Author Posted November 13, 2006 Yes that's what i want Thank you very much
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