mIRC Home    About    Download    Register    News    Help

Print Thread
#53036 09/10/03 03:06 AM
Joined: Aug 2003
Posts: 15
H
Pikka bird
OP Offline
Pikka bird
H
Joined: Aug 2003
Posts: 15
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?*


IRC.MediaDriven.COM - Live the Phantasy PhantasyX Script v3.0 - @#Scripting - www.mircscripts.org
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
/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) $+ *.*
}


-KingTomato
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
You may find this useful.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
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


I refuse to engage in a battle of wits with an unarmed person. wink
Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
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.

new username: tidy_trax
Joined: Jun 2003
Posts: 384
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2003
Posts: 384
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

Joined: May 2003
Posts: 2,265
P
Hoopy frood
Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
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


new username: tidy_trax
Joined: Jun 2003
Posts: 384
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2003
Posts: 384
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)
}


$input(Me like stars, You too?)

Link Copied to Clipboard