Jump to content

Delete files in all drives that is specified in .ini file


euverve
 Share

Recommended Posts

Use a loop to loop through the drives.

Any body could improve my code? Thanks

----------------------------------------------------------------

$DISK = DriveGetDrive("ALL") & "\"

$files = IniReadSection("deletefiles.ini", "Files")

$del = $DISK & $files

If @error Then

MsgBox(4096, "", "Error occured, probably no INI file.")

Else

For $I = 1 To $del [0]

$STATS = DriveStatus($DISK[$I])

If $STATS = "READY" Then

FileSetAttrib($del[$I], "-RSH+N")

FileDelete($del[$I])

EndIf

Next

EndIf

----------------------------------------------------------------

Any suggestions, thanks

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...