Dieuz 0 Posted August 26, 2010 (edited) Hi, I have a folder containing over 500 files. I would like to convert each of these filename to become lowercase. What would be the more efficient way to do it? Thanks! Edited August 26, 2010 by Dieuz Share this post Link to post Share on other sites
Danny35d 15 Posted August 26, 2010 Try it:#include <File.au3> Local $FilePath = 'C:\Temp' $FileList = _FileListToArray($FilePath, '*', 1) If IsArray($FileList) Then For $x = 1 To $FileList[0] FileMove($FilePath & '\' & $FileList[$x], StringLower($FilePath & '\' & $FileList[$x]), 9) Next EndIf AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Share this post Link to post Share on other sites
Dieuz 0 Posted August 26, 2010 That works like a charm! Thanks alot Danny! Share this post Link to post Share on other sites
Spiff59 54 Posted August 26, 2010 (edited) I'm not sure how long and convoluted your pathnames are, or whether you want to mess with directory names, or how many times this line of code is going to be executed, but... I would think: FileMove($FilePath & '\' & $FileList[$x], StringLower($FilePath & '\' & $FileList[$x]), 9) ought to be: FileMove($FilePath & '\' & $FileList[$x], $FilePath & '\' & StringLower($FileList[$x]), 9) Edit: Actually, since you mentioned "efficient", this would likely be the best refinement of Danny's code: #include <File.au3> Local $DirPath = 'C:\Temp' $FileList = _FileListToArray($DirPath, '*', 1) If IsArray($FileList) Then $DirPath &= "\" For $x = 1 To $FileList[0] $FilePath = $DirPath & StringLower($FileList[$x]) FileMove($FilePath, $FilePath, 9) Next EndIf Edited August 27, 2010 by Spiff59 Share this post Link to post Share on other sites