Can autoit search a drive & delete empty folders?
#1
Posted 09 July 2004 - 08:45 PM
#2
Posted 10 July 2004 - 03:41 AM
#3
Posted 10 July 2004 - 04:24 AM
So...Removes (deletes) a directory.
RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path
/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.
/Q Quiet mode, do not ask if ok to remove a directory tree with /S
$folder = '"C:\my folder"' Run(@ComSpec & " /c rmdir /S /Q " & $folder, "", @SW_HIDE)
#4
Posted 10 July 2004 - 04:33 AM
I need to search the whole c drive and remove any empty folders it finds.
#5
Posted 10 July 2004 - 04:41 AM
You could probably code AutoIt to do that, but I found a nifty one by using a google search that might be very helpful.
#6
Posted 10 July 2004 - 04:49 AM
#7
Posted 10 July 2004 - 05:19 AM
http://www.snapfiles.com/get/rmempty.html
Can you show me how I can add the drive letter in with a input box .
Run(@ComSpec & " /k RMEMPTY.EXE C:\")
Right now I have it hard coded in .
Edited by bobheart, 10 July 2004 - 05:21 AM.
#8
Posted 10 July 2004 - 05:41 AM
$drive = FileSelectFolder("Select drive or folder to remove empty folders from","",0) Run(@ComSpec & " /k RMEMPTY.EXE " & $drive)
untested, but here you go.
#9
Posted 10 July 2004 - 05:57 AM
#10
Posted 11 July 2004 - 12:54 AM
ie
if Filegetsize($myfolder) = 0 then filedelete($myfolder)
or whatever.. (didn't test this.. but just a thought)
#11
Posted 11 July 2004 - 01:08 AM
If you could show a little more code so I could try it . then i could get rid of the other exe .I don't suppose FileGetSize could have worked here too?
ie
if Filegetsize($myfolder) = 0 then filedelete($myfolder)
or whatever.. (didn't test this.. but just a thought)
#12
Posted 11 July 2004 - 01:50 AM
but maybe a round about way? ie looking in the folder for *.* and if no results returned the delete..??
More complicated I think..
#13
Posted 11 July 2004 - 01:55 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users





