Jump to content

DirRemove w/ Wildcard


Recommended Posts

I found this thread w/ a non working example: '?do=embed' frameborder='0' data-embedContent>>

I made a few changes and now it appears it is working.

#RequireAdmin

$path = "C:\Users\frpatrmo\desktop\home\"
$search = FileFindFirstFile("C:\Users\frpatrmo\desktop\home\test*")
While 1
    $file = FileFindNextFile($search)
    If @Error then ExitLoop
    ;debug current file name
    ;MsgBox(0, "", $file)
    $ats = FileGetAttrib($path & $file)
    ;debug current file attribute
    ;MsgBox(0, "", $ats)
    If StringInStr($ats, "D") Then
        DirRemove($path & $file, 1)
    EndIf
WEnd
Anybody know a better way to do a "wildcard" file/dir delete? I know the FileDelete() supports them by default, so this would be mostly for directory removal. I used it to clean up these oracle folders that had random names.
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...