jben Posted April 17, 2008 Posted April 17, 2008 hey does anyone know how to use FileListToArray as a wildcard for a folder. I presume its something like the following: $FileList = _FileListToArray($targetDir,"",0) and maybe put "\" as the search criteria? thanks
jben Posted April 17, 2008 Author Posted April 17, 2008 Isn't that a wildcard for files though?... I'm basically trying to check a folder to see if another folder exists within that folder..
weaponx Posted April 17, 2008 Posted April 17, 2008 Isn't that a wildcard for files though?...I'm basically trying to check a folder to see if another folder exists within that folder..Use FileExists(). It works with folders too.
jben Posted April 17, 2008 Author Posted April 17, 2008 The idea of this code is to check the 29944M_10386 folder to see if another folder exists. If another folder exists then it will rename the zip file stored within that folder. I know I could just refer to the zip folder but I have the issue that the folder name can change, therefore im trying to take a step back and code it so that my program can check the folder... $targetDir = "C:\TEMP\29944M_10386\" $aZipList = _FileListToArray($targetDir,"*",0) If IsArray($aZipList) Then FileMove($targetDir &$aZipList[1],"\DATA_CHILD.zip") EndIf
jben Posted April 17, 2008 Author Posted April 17, 2008 (edited) Sorry if i confused you. This is the original idea. Which renames the zip file to DATA_CHILD.zip..This works fine, however the 1234 folder can change, therefore I don't want to use that within the code... $targetDir = "C:\TEMP\29944M_10386\1234\" $aZipList = _FileListToArray($targetDir,".zip",0) If IsArray($aZipList) Then FileMove($targetDir &$aZipList[1],"C:\TEMP\29944M_10386\1234\DATA_CHILD.zip") EndIf Edited April 17, 2008 by jben
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