bobheart Posted July 9, 2004 Share Posted July 9, 2004 Can autoit search a drive & delete empty folders? Link to comment Share on other sites More sharing options...
bobheart Posted July 10, 2004 Author Share Posted July 10, 2004 No ? Link to comment Share on other sites More sharing options...
pekster Posted July 10, 2004 Share Posted July 10, 2004 Removes (deletes) a directory. RMDIR [/Q] [drive:]path RD [/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 /SSo... $folder = '"C:\my folder"' Run(@ComSpec & " /c rmdir /S /Q " & $folder, "", @SW_HIDE) [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
bobheart Posted July 10, 2004 Author Share Posted July 10, 2004 That would just delete C:\my folder right ? I need to search the whole c drive and remove any empty folders it finds. Link to comment Share on other sites More sharing options...
pekster Posted July 10, 2004 Share Posted July 10, 2004 Bah, sorry. I'm not reading properly today You could probably code AutoIt to do that, but I found a nifty one by using a google search that might be very helpful. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
bobheart Posted July 10, 2004 Author Share Posted July 10, 2004 Yes I found them too . all want the money . lol Link to comment Share on other sites More sharing options...
bobheart Posted July 10, 2004 Author Share Posted July 10, 2004 (edited) I found this one that seems to work .http://www.snapfiles.com/get/rmempty.htmlCan 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 July 10, 2004 by bobheart Link to comment Share on other sites More sharing options...
emmanuel Posted July 10, 2004 Share Posted July 10, 2004 why not... $drive = FileSelectFolder("Select drive or folder to remove empty folders from","",0) Run(@ComSpec & " /k RMEMPTY.EXE " & $drive) untested, but here you go. "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
bobheart Posted July 10, 2004 Author Share Posted July 10, 2004 Thank you that was perfect .. Link to comment Share on other sites More sharing options...
cowsmanaut Posted July 11, 2004 Share Posted July 11, 2004 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) Link to comment Share on other sites More sharing options...
bobheart Posted July 11, 2004 Author Share Posted July 11, 2004 I don't suppose FileGetSize could have worked here too? ieif Filegetsize($myfolder) = 0 then filedelete($myfolder)or whatever.. (didn't test this.. but just a thought)If you could show a little more code so I could try it . then i could get rid of the other exe . Link to comment Share on other sites More sharing options...
cowsmanaut Posted July 11, 2004 Share Posted July 11, 2004 yeah I just read the help file on it.. says "does not work on directories" for the FileGetSize function in autoit.. but maybe a round about way? ie looking in the folder for *.* and if no results returned the delete..?? More complicated I think.. Link to comment Share on other sites More sharing options...
bobheart Posted July 11, 2004 Author Share Posted July 11, 2004 Ok i'll stick with what i found unless something comes along better . 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