mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Quote:
/rmdir <dirname>
Deletes the specified directory.
Note: If the directory contains files, it cannot be deleted.


That's fair enough but is there's another way round to it? - Because I'm trying to delete files and subdirectories rather than doing them manually everytime.

Hope a suggestion or code... thx
Colt

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Use $findfile to count the files in the directory.

Then a loop to /remove them.

/remove [-b] <filename>
Deletes the specified file.
The -b switch deletes the file and moves it to the recycle bin.


Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Yes, but what about subdirectories? smile

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
There's probably a better way to do what you're trying to do, although you haven't bothered to explain what it is you're trying to do.

//noop $findfile(DIR,*,0,remove -b $qt($1-)) works fine for me.

edit: correction

Last edited by argv0; 17/09/09 09:16 PM.

- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
//noop $findfile(DIR,*,0,0,remove -b $qt($1-)) make it not searching any subdirectory, should not be used here

Last edited by Wims; 17/09/09 07:44 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Originally Posted By: argv0
There's probably a better way to do what you're trying to do, although you haven't bothered to explain what it is you're trying to do.

//noop $findfile(DIR,*,0,remove -b $qt($1-)) works fine for me.

edit: correction


I did say files and subdirectories but thanks - will try that now.

Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Ok, appears to work only on FILES including all the files from subdirectories.

But the folder still there frown

i.e.

c:\TEST\
c:\TEST\FOLDER1
c:\TEST\FOLDER1\test.txt
c:\TEST\FOLDER1\test2.txt
c:\TEST\FOLDER2
c:\TEST\FOLDER2\test1.txt
c:\TEST\FOLDER2\test2.txt
c:\TEST\FOLDER3
c:\TEST\FOLDER3\test1.txt
c:\TEST\FOLDER3\test2.txt

Want to script something that completely remove C:\TEST folder along with the rest of subdirectories and files.

Thx

Last edited by colt45; 17/09/09 10:12 PM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Code:
alias _rmdir .comopen a Scripting.FileSystemObject | .comclose a $com(a,DeleteFolder,1,string,$1-)
/_rmdir path, do not use quote even if the path has spaces


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2003
Posts: 101
C
colt45 Offline OP
Vogon poet
OP Offline
Vogon poet
C
Joined: Nov 2003
Posts: 101
Oh Nice!! - Just how I wanted! laugh

Many thanks! :D:D


Link Copied to Clipboard