mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2005
Posts: 41
S
swgiant Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2005
Posts: 41
/remove command is quite weak, then i want to ask any better to use $com to perform a deletion? then how to implement the codes? thanks...

Last edited by swgiant; 12/09/07 09:22 AM.
Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
I imagine it can be done with $com statements, but why do you think /remove is "weak"?


Yar
Joined: Jan 2005
Posts: 41
S
swgiant Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2005
Posts: 41
it cant remove certain of attributed files like read-only. i want to try $com, just maybe $com can perform like windows do...

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Until someone finds or comes up with a COM Objects solution, using the -b switch in the /remove call will remove read only files. But as stated in the help file:

The -b switch deletes the file and moves it to the recycle bin.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
alias _remove { 
  var %obj = fso $+ $ctime, %file = $iif($nopath($1-) == $1-,$mircdir $+ $1-,$1-)
  .comopen %obj scripting.filesystemobject
  if (!$comerr) {
    if (!$com(%obj,DeleteFile,3,bstr,%file,bool,true)) { echo -ac info * /_remove: $iif(!$isfile(%file),the file does not exist.,the file is in use.) }
    else { echo -acq info * /_remove: removed $qt(%file) }
    .comclose %obj
  }
}


Same usage as /remove

Joined: Jan 2005
Posts: 41
S
swgiant Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jan 2005
Posts: 41
thanks... the $com delete command much powerful than /remove


Link Copied to Clipboard