mIRC Home    About    Download    Register    News    Help

Print Thread
Delete a file that is in use #230360 05/03/11 06:44 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
Hello,

I wanna ask if there is any Windows command or with any .dll , .exe file that can i delete a file that is in use!

- Thanks!

Re: Delete a file that is in use [Re: westor] #230363 05/03/11 06:46 PM
Joined: Dec 2002
Posts: 2,010
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,010

Delete a file from within mIRC or in Windows?

Try this
http://unlocker.emptyloop.com/

Re: Delete a file that is in use [Re: RoCk] #230364 05/03/11 07:05 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
I am looking for a command or utility that will work with no setup.

Re: Delete a file that is in use [Re: westor] #230387 06/03/11 07:18 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
According to the help file:
Quote:
/remove [-b] <filename>

Deletes the specified file.

The -b switch deletes the file and moves it to the recycle bin.
If this is what you're looking for.... This command is mIRC specific.

* And you still haven't answered RoCk's question.
Quote:
Delete a file from within mIRC or in Windows?



Re: Delete a file that is in use [Re: Tomao] #230393 07/03/11 12:22 AM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
I knew the mIRC command but if a file is in use the mIRC does not delete it and returns an error!

Re: Delete a file that is in use [Re: westor] #230394 07/03/11 02:35 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
There *may* be a built-in Windows method to delete files that are in use (perhaps using COM), but I'm not sure. Normally, you have to use a third party utility or restart the computer if you aren't able to get the file out of use.


Invision Support
#Invision on irc.irchighway.net
Re: Delete a file that is in use [Re: westor] #230397 07/03/11 07:12 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You can try this by entering the command via mIRC:
Code:
/run cmd /c del file.txt
Replace file.txt with the actual file name you wish to delete. This opens the window command prompt momentarily and executes the deletion of a file.

Re: Delete a file that is in use [Re: westor] #230433 08/03/11 10:09 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
There's a "bug"(?) in older(?) versions of windows that allows you to rename a file that is in use and delete that. The file will continue to be in use, though.

If that doesn't work, you cannot delete a file that is in use, nor should you try. Stop using it, first, then delete it.

No builtin command work if the standard right click -> delete functionality in the Windows Explorer does not work. Windows gives you this message for a reason.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Delete a file that is in use [Re: argv0] #230434 08/03/11 10:51 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I read it here at this link:

http://www.cypherhackz.net/archives/2007/01/16/how-to-delete-in-use-file-in-windows/

(unless the person who wrote the claim is full of it) that you can force delete an in-use file through the command prompt. The demonstration is for xp but should work for vista and windows 7 the same way.

Re: Delete a file that is in use [Re: Tomao] #230435 08/03/11 11:16 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Yeah, that author is full of it. The del command isn't going to do anything (other than giving you an error) if you can't right click and delete the file. (Or if /remove doesn't work in mIRC)

The file has to be closed before deleting it. I believe third party utilities just find a way to close it. Perhaps they find out what program is using it and close that. I really don't know because I don't bother. I have just restarted the computer the few times I've had a file that was marked as being in-use.

Last edited by Riamus2; 08/03/11 11:17 AM.

Invision Support
#Invision on irc.irchighway.net
Re: Delete a file that is in use [Re: Tomao] #230436 08/03/11 11:20 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
A simple test (say, copy some audio file, play the file and try to delete while playing) will show that this won't work. As pointed out, you have to e.g. close the file handle first - and there's no simple command for the task, even though there are user-friendly tools for it (like the one RoCk linked to).

Re: Delete a file that is in use [Re: Horstl] #230441 08/03/11 07:26 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Thank you two for the reconfirmation.

Re: Delete a file that is in use [Re: Tomao] #230450 09/03/11 04:17 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
The program probably uses the rename trick, which you can use in mIRC too:

Play some mp3 file foo.mp3
/rename foo.mp3 bar.mp3
/remove bar.mp3

If the rename works, the remove works. I couldn't do this in Win7, but I also couldn't rename it through explorer, which I remember being able to do in XP. IOW the bug may have been fixed.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Delete a file that is in use [Re: argv0] #230455 09/03/11 10:31 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Yes, that trick worked under Vista. I added the -b switch and it was removed to the recycle bin while the song was still playing.