mIRC Home    About    Download    Register    News    Help

Print Thread
New Commad[Removing things] #53036 09/10/03 03:06 AM
Joined: Aug 2003
Posts: 15
H
HigherDragon Offline OP
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
Re: New Commad[Removing things] #53037 09/10/03 03:36 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
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
Re: New Commad[Removing things] #53038 09/10/03 03:44 AM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
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...

Re: New Commad[Removing things] #53039 09/10/03 08:32 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
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
Re: New Commad[Removing things] #53040 09/10/03 11:56 AM
Joined: Jun 2003
Posts: 994
C
CtrlAltDel Offline
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
Re: New Commad[Removing things] #53041 09/10/03 12:30 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
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
Re: New Commad[Removing things] #53042 09/10/03 12:31 PM
Joined: Jun 2003
Posts: 384
D
DekuHaze Offline
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

Re: New Commad[Removing things] #53043 09/10/03 12:36 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline
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
Re: New Commad[Removing things] #53044 09/10/03 12:40 PM
Joined: Jun 2003
Posts: 384
D
DekuHaze Offline
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

Re: New Commad[Removing things] #53045 09/10/03 01:40 PM
Joined: Dec 2002
Posts: 117
R
Rich Offline
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?)