Jump to content

File list wildcard


jben
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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 by jben
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...