Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Can autoit search a drive & delete empty folders?


  • Please log in to reply
12 replies to this topic

#1 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 09 July 2004 - 08:45 PM

Can autoit search a drive & delete empty folders?







#2 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 10 July 2004 - 03:41 AM

No ?

#3 pekster

pekster

    Newfound chai tea convert

  • Active Members
  • PipPipPipPipPipPip
  • 902 posts

Posted 10 July 2004 - 04:24 AM

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

So...
$folder = '"C:\my folder"' Run(@ComSpec & " /c rmdir /S /Q " & $folder, "", @SW_HIDE)

"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."Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

#4 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 10 July 2004 - 04:33 AM

That would just delete C:\my folder right ?
I need to search the whole c drive and remove any empty folders it finds.

#5 pekster

pekster

    Newfound chai tea convert

  • Active Members
  • PipPipPipPipPipPip
  • 902 posts

Posted 10 July 2004 - 04:41 AM

Bah, sorry. I'm not reading properly today :ph34r:
You could probably code AutoIt to do that, but I found a nifty one by using a google search that might be very helpful.
"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."Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

#6 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 10 July 2004 - 04:49 AM

Yes I found them too . all want the money . lol

#7 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 10 July 2004 - 05:19 AM

I found this one that seems to work .
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 emmanuel

emmanuel

    No one ever accused me of being normal.

  • Active Members
  • PipPipPipPipPipPip
  • 1,128 posts

Posted 10 July 2004 - 05:41 AM

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)

#9 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 10 July 2004 - 05:57 AM

Thank you that was perfect ..

#10 cowsmanaut

cowsmanaut

    Adventurer

  • Active Members
  • PipPip
  • 135 posts

Posted 11 July 2004 - 12:54 AM

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)

#11 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 11 July 2004 - 01:08 AM

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)

If you could show a little more code so I could try it . then i could get rid of the other exe .

#12 cowsmanaut

cowsmanaut

    Adventurer

  • Active Members
  • PipPip
  • 135 posts

Posted 11 July 2004 - 01:50 AM

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.. :ph34r:

#13 bobheart

bobheart

    Make it idiot proof and someone will make a better idiot

  • Active Members
  • PipPipPipPipPipPip
  • 632 posts

Posted 11 July 2004 - 01:55 AM

Ok i'll stick with what i found unless something comes along better .




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users