Jump to content
Sign in to follow this  
CodeMaster Rapture

FileFindFirstFile, return only directories?

Recommended Posts

CodeMaster Rapture

Allo again,

I'm working on a little script to clean up my World of Warcraft folders and came across a strange hurdle. What I'm doing is finding the install dir and then making a list of all sub-folders. Only problem is, it will list files aswell as folders. Is there a way to test a path to see if it is a file or folder?

Here's what I've got thus far:

    WoW Cleaner
    Version 1.0.1
#include <Array.au3>

Global $sz_AddOns[1] = [0]

If (ProcessExists("World of Warcraft") Or ProcessExists("wow.exe")) Then
    MsgBox(16,"Error","This application can only be run when World of Warcraft is not running.")

;Find WoW Folder
$sz_GameFolder = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Blizzard Entertainment\World of Warcraft","InstallPath")
If (@error Or $sz_GameFolder == "") Then
    MsgBox(16,"Error","Unable to find World of Warcraft installation.")

;List and count AddOns
FileChangeDir(@WorkingDir & "\Interface\AddOns")

Local $h_AddOn_List = FileFindFirstFile("*")
If (@error) Then
    MsgBox(16,"Error","Failed to retrieve list of AddOns.")

While 1
    $f_AddOn = FileFindNextFile($h_AddOn_List)
    If (@error) Then
    $sz_AddOns[0] += 1


MsgBox(0,"AddOns","AddOns:" & @CRLF & "------------------" & @CRLF & _ArrayToString($sz_AddOns,@CRLF,1,$sz_AddOns[0]) & @CRLF & "Total: " & $sz_AddOns[0])

Let's say there are some text files there, it will list those as well, which I don't want.

Thanx in advance,


Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.