CodeMaster Rapture Posted June 2, 2007 Share Posted June 2, 2007 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: expandcollapse popup#cs WoW Cleaner Version 1.0.1 #ce #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.") Exit EndIf ;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.") Exit EndIf FileChangeDir($sz_GameFolder) ;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.") Exit EndIf While 1 $f_AddOn = FileFindNextFile($h_AddOn_List) If (@error) Then ExitLoop EndIf _ArrayAdd($sz_AddOns,$f_AddOn) $sz_AddOns[0] += 1 WEnd FileClose($h_AddOn_List) 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, CMR Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 2, 2007 Moderators Share Posted June 2, 2007 http://www.autoitscript.com/forum/index.ph...st&p=246376 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
CodeMaster Rapture Posted June 2, 2007 Author Share Posted June 2, 2007 http://www.autoitscript.com/forum/index.ph...st&p=246376Oops, musta missed that UDF in the help file... Sorry...Thanx SmOke_N Link to comment Share on other sites More sharing options...
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