VBscript to delete multiple .txt files from a directory with 0kb size and with current date -


how can have vbscript delete multiple .txt files directory 0kb size , current date?

this tested version , should works ;)

option explicit dim fs, f, f1, d, mydate set fs = createobject("scripting.filesystemobject") set f = fs.getfolder("e:\test") each f1 in f.files     d = f1.datelastmodified     mydate = split(d," ")     if f1.size = 0 , cdate(mydate(lbound(mydate))) = date          fs.deletefile f1.path,true end if next set fs = nothing set f = nothing set f1 = nothing 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -