Moderators Melba23 Posted March 10, 2013 Author Moderators Share Posted March 10, 2013 kamuline, I explain how you might do this here. And before you ask, I am not adding an option to do this into the UDF itself - I get enough stick from Spiff59 about the size of it already! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Noviceatthis Posted March 21, 2013 Share Posted March 21, 2013 Hello all,Sorry for the question, i'm still an amateur when it comes to autoitI am a little confused as to the syntax of the parameters of this UDF, taking from an example iv seen:_RecFileListToArray ($SourceDir, $Ext, 1, 0, 0, 2)I know that the first two parameters are the source directory and the file extension, but what are the other four??Again, sorry for the basic question Link to comment Share on other sites More sharing options...
BrewManNH Posted March 21, 2013 Share Posted March 21, 2013 All of that is explained in the header of the function in the comments. Which one in particular are you questioning? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 21, 2013 Author Moderators Share Posted March 21, 2013 Noviceatthis,Look at the function header inside the UDF - if the author goes to the trouble to write one it is usually worth reading. ; #FUNCTION# ==================================================================================================================== ; Name...........: _RecFileListToArray ; Description ...: Lists files and\or folders in a specified path with optional recursion to defined level and result sorting ; Syntax.........: _RecFileListToArray($sPath[, $sMask = "*"[, $iReturn = 0[, $iRecur = 0[, $iSort = 0[, $iReturnPath = 1[, $sExclude_List = ""[, $sExclude_List_Folder]]]]]]]) ; Parameters ....: $sPath - Initial path used to generate filelist. If path ends in \ then folders will be returned with an ending \ ; $sMask - Optional: Filter for result. Multiple filters must be separated by ";" ; Use "|" to separate 3 possible sets of filters: "Include|Exclude|Exclude_Folders" ; Include = Files/Folders to include (default = "*" [all]) ; Exclude = Files/Folders to exclude (default = "" [none]) ; Exclude_Folders = only used if basic $iReturn = 0 AND $iRecur = 1 to exclude defined folders (default = "" [none]) ; $iReturn - Optional: specifies whether to return files, folders or both and omits those with certain attributes ; 0 - Return both files and folders (Default) ; If non-recursive Include/Exclude_List applies to files and folders ; If recursive Include/Exclude_List applies to files only, all folders are searched unless excluded using $sExclude_List_Folder ; 1 - Return files only - Include/Exclude_List applies to files only, all folders searched if recursive ; 2 - Return folders only - Include/Exclude_List applies to folders only for searching and return ; Add one or more of the following to $iReturn to omit files/folders with that attribute ; + 4 - Hidden files and folders ; + 8 - System files and folders ; + 16 - Link/junction folders ; Note: Omitting files/folders uses a different search algorithm and takes approx 50% longer ; $iRecur - Optional: specifies whether to search recursively in subfolders and to what level ; 1 - Search in all subfolders (unlimited recursion) ; 0 - Do not search in subfolders (Default) ; Negative integer - Search in subfolders to specified depth ; $iSort - Optional: sort ordered in alphabetical and depth order ; 0 - Not sorted (Default) ; 1 - Sorted ; 2 - Sorted with faster algorithm (assumes files sorted within each folder - requires NTFS drive) ; $iReturnPath - Optional: specifies displayed path of results ; 0 - File/folder name only ; 1 - Relative to initial path (Default) ; 2 - Full path includedSo those 4 parameters are:- $sPath = The root of the search- $sMask = The fies/folders to search for- $iReturn = Whether you want files, folders or both- $iRecur = Whether to look in just the root folder or search in all subfolder as wellClearer now? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Noviceatthis Posted March 21, 2013 Share Posted March 21, 2013 Much clearer, thanks Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 21, 2013 Author Moderators Share Posted March 21, 2013 Noviceatthis, Delighted to hear it. Do ask again if you need any further help. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
litlmike Posted April 5, 2013 Share Posted April 5, 2013 When I try to read this directory "C:\Windows\System32\oobe\info\backgrounds" I receive this: Error: 1 - Extended: 1 Any suggestions? I think it has to do with the length of the directory name because RecFileListToArray() will work for "C:\Windows\System32\oobe\", but not anything longer than that. $aArray = _RecFileListToArray("C:\Windows\System32\oobe\info\backgrounds\") ConsoleWrite("Error: " & @error & " - " & " Extended: " & @extended & @CRLF) _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2013 Author Moderators Share Posted April 5, 2013 litlmike,The error values show that the UDF cannot find the path - all it does internally is use FileExists to check, so what does this return: MsgBox(0, "Does it exist?", FileExists("C:\Windows\System32\oobe\info\backgrounds\"))M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Chimaera Posted April 5, 2013 Share Posted April 5, 2013 That folder mike doesn't even exist for me only the oobe folder is there for me - Win7 64 bit If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
BrewManNH Posted April 5, 2013 Share Posted April 5, 2013 What OS are you using, and is it x64 or x86? Is the script running as x64 or x86? My Windows 7 machine doesn't have an "info" folder in the "oobe" folder in either System32 or SysWOW64. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
litlmike Posted April 5, 2013 Share Posted April 5, 2013 litlmike, The error values show that the UDF cannot find the path - all it does internally is use FileExists to check, so what does this return: MsgBox(0, "Does it exist?", FileExists("C:\Windows\System32\oobe\info\backgrounds\")) M23 It returns a 0. But, I can see the folder by pasting the string into the address bar. That folder mike doesn't even exist for me only the oobe folder is there for me - Win7 64 bit Interesting.... What OS are you using, and is it x64 or x86? Is the script running as x64 or x86? My Windows 7 machine doesn't have an "info" folder in the "oobe\" folder in either System32 or SysWOW64. I am running Win 7 x64. Script is running x86. Some Win 7 machines may not have the folder by default, if the Splash Screen has never been modified. So, if you come straight out of a clean install and use default Win 7 splash screen, there was no reason for the folder to be created. But, if you bought a machine for Dell, Lenovo, etc. they likely have changed the default splash screen and those folders have been created. _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2013 Author Moderators Share Posted April 5, 2013 litlmike,For interest my Dell Vista X32 system has the "oobeinfo" folder, but nothing below that. Anyway the UDF is not at fault - if AutoIt cannot see the folder the UDF can hardly be expected read its contents. I wonder if there is some form of MS "too clever for its own good" folder redirection going on and the actual folder is somewhere else? This problem has arisen from time to time when apps try to write to protected folders on the C: drive - I can well imagine "WindowsSystem32" is one of them. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
litlmike Posted April 5, 2013 Share Posted April 5, 2013 litlmike, For interest my Dell Vista X32 system has the "oobeinfo" folder, but nothing below that. Anyway the UDF is not at fault - if AutoIt cannot see the folder the UDF can hardly be expected read its contents. I wonder if there is some form of MS "too clever for its own good" folder redirection going on and the actual folder is somewhere else? This problem has arisen from time to time when apps try to write to protected folders on the C: drive - I can well imagine "WindowsSystem32" is one of them. M23 I think you are right and I Fixed it! BrewManNH made me think that it was just an x86 vs x64 issue. I added this wrapper and it seems to be working. #AutoIt3Wrapper_UseX64=Yes _ArrayPermute()_ArrayUnique()Excel.au3 UDF Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 5, 2013 Author Moderators Share Posted April 5, 2013 litlmike, Excellent! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
BrewManNH Posted April 5, 2013 Share Posted April 5, 2013 Sounds like folder redirection at work, when it's compiled as a 32 application, then it's looking in the SysWOW64 folder for that folder, and not System32. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Xerix Posted June 11, 2013 Share Posted June 11, 2013 Hello I noticed that on a long folder (more than 260 characters), RecFileListToArray cannot find file. Is there a possibility to remove this limit ? Thank you Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 11, 2013 Author Moderators Share Posted June 11, 2013 (edited) Xerix, The 260 character limit is a Windows limtiation - from MSDN: Maximum Path Length LimitationIn the Windows API [...] the maximum length for a path is MAX_PATH, which is defined as 260 characters.But it goes on to say: The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. [...] To specify an extended-length path, use the "?" prefix. For example, "?D:very long path".So try adding "?" to the root that you pass to the function and see if that does the trick. If not, I suggest you shorten your paths a bit! M23 Edited June 11, 2013 by Melba23 Added link Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Xerix Posted June 11, 2013 Share Posted June 11, 2013 Hello Melba23, I discovered recently that limitation of 260 characters. Personally I never do as long path but the people who I provide my program do. I told them that this was not reasonable, but they do anyway. The technique of "? " seems to work but the result of the array also contains this text. It is not very complicated to delete after, but could we not add it to RecFileListToArray for research and then remove the prefix so that the array displays only the path. Thank you Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 11, 2013 Author Moderators Share Posted June 11, 2013 Xerix,I will take a look and see what I can do. Most likely an automated removal of the prefix from the results if it is present in the initial path. But I will not accept any changes which affects the time taken to any great extent - speed is always of the essence with this UDF. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Xerix Posted June 11, 2013 Share Posted June 11, 2013 Thank you Melba23 Link to comment Share on other sites More sharing options...
Recommended Posts