dinoking Posted May 4, 2008 Share Posted May 4, 2008 (edited) How do you write code "Delete files by size" ? I want delele all files by size EX: delete file > 100kb Thanks Edited May 4, 2008 by dinoking Link to comment Share on other sites More sharing options...
amokoura Posted May 4, 2008 Share Posted May 4, 2008 Read manual for file functions Link to comment Share on other sites More sharing options...
FreeRider Posted May 5, 2008 Share Posted May 5, 2008 Hi Dinoking, Amokoura is right.... read help file before asking such question... however here is the way to do it : First you have to list all the files of the folder (Use _FileSearch() or new _FileListToArray() from the forum) Once you have your list into an array you must loop and test each item of the array looking for it size For $i = 1 to $Mylist[0] $size = FileGetSize("$FullPathToFile"); Size is in bytes If $size > 102400 (equiv to 100 Kb) Then FileDetele("$FullPathToFile") Next Hope this will help you... Bye FreeRiderHonour & Fidelity 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