mIRC Home    About    Download    Register    News    Help

Print Thread
#53036 09/10/03 03:06 AM
H
HigherDragon
HigherDragon
H
I think it would be very useful for mIRC to be able to delete directorys with file names in them.
/rmdir only deletes folders without files in them.
*Which is pretty lame? Why would you want to delete a folder with nothing in it? It would be best to be able to remove whole foldes with things in them?*

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
/imtoolazy {
var %dir = $1-
var %a = $findfile(%dir, *.*, 0, remove $shortfn($1-))
/rmdir %dir
}

/imtoolazy_part2 {
var %dir = $1-
/run cmd /c del /Q /S $shortfn(%dir) $+ *.*
}

C
codemastr
codemastr
C
First off that's not a limitation of mIRC, that's a limitation of any sane operating system. A directory is not a file, deleting a directory is different than deleting a file. Therefore the operations should not be mixed. Furthermore, why exactly would you ever want to delete an entire file and its contents without actually prompting the user? Seems like the only reason to do that would be to delete files without letting the user know...

Joined: Jan 2003
Posts: 2,125
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,125
You may find this useful.

C
CtrlAltDel
CtrlAltDel
C
Since you're only doing this on your own computer (aren't you??) what's the problem with typing
/run explorer.exe path\to\the\folder\
I see no reason for mirc to emulate windows explorer

P
pheonix
pheonix
P
Code:
alias rmdir {
  if ($1 == -r) {
    if (!$exists($iif("*" iswm $2-,$2-," $+ $2- $+ "))) { return }
    if ($input(are you sure you want to delete $2- and everything in it?,owd,warning) != $true) { return }
    .echo -q $findfile($iif("*" iswm $2-,$2-," $+ $2- $+ "),*.*,0,remove $+(",$1-,"))
    !rmdir $iif("*" iswm $2-,$2-," $+ $2- $+ ")
  }
  else {
    if (!$exists($iif("*" iswm $1-,$1-," $+ $1- $+ "))) { return }
    !rmdir $1-
  }
}


/rmdir -r "c:\filepath"

Last edited by pheonix; 09/10/03 12:44 PM.
D
DekuHaze
DekuHaze
D
Linux is sane and lets you delete the directory and all its contents, but only if you specify a recursive deletion (rm -dr <dir>). Hasn't proved to be a problem, as far as security warnings go smile

I think it's a valid suggestion. I was going to suggest it myself after reading the thread in mIRC Help, if it wasn't here already. laugh

P
pheonix
pheonix
P
Quote:
I think it's a valid suggestion.


newbie idiot: so i just load your script?
idiot: yep.
newbie idiot: it says run initializing settings, what should i click?
idiot: yes
newbie idiot: it's deleting my c: drive shocked
idiot: laugh

D
DekuHaze
DekuHaze
D
Newbie should run his Windows box without being an administrator user all the time. Perhaps newbie should be renamed "idiot" wink

On the other hand, perhaps a "Do you really want to delete <whatever>?" dialogue should pop up or something laugh

Joined: Dec 2002
Posts: 117
R
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
You have to remove all subdirectories as well:
Code:
alias imlazy {
  var %dir = $1-
  var %a = $findfile(%dir, *.*,0,remove $shortfn($1-))
  var %b = $finddir(%dir,*,0,rmdir $shortfn($1-))
  rmdir $shortfn(%dir)
}


Link Copied to Clipboard