Jump to content
Sign in to follow this  

DirRemove: Removes but will not delete?

Recommended Posts


New to AutoIt;

I am trying to delete old directories from backup automatically but when DirRemove runs, it says it deletes yet the directory on that drive disappears but the actual space on the drive remains the same!! Is this possible?

FYI: there is NO recycle bin on this drive so there is nowhere to really empty. It is a Buffalo network drive with the recycle bin un-active.

Any suggestions? (the send part is because it is writing on a notepad.exe doc)

If FileExists($delfolder) Then

; MsgBox for testing only

;MsgBox(4096, "", "Folder exists.")

; Delete $days Day Old folder and all subdirs and files (folder name, yes remove subs and files init


Send(" day old folder named ")


Send(" has been DELETED")

DirRemove($delfolder, 1)


;MsgBox(4096,"", "Folder does not exist.")

Send("Folder not found, nothing deleted")

Share this post

Link to post
Share on other sites

You may have to run the disc defragmentator and/or disk clean up after deleting a directory to free the disk space.

Right click the drive, then click properties.

To run disk clean up, click the the button that says "Disk Cleanup" under the general tab.

To run the defragmentator, select the tools tab and click "Defragment Now"

It may take a while depending on the amount of junk and fragmented files on the drive.


Edited by Hallman

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