mIRC Home    About    Download    Register    News    Help

Topic Options
#230360 - 05/03/11 06:44 PM Delete a file that is in use
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
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!
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#230363 - 05/03/11 06:46 PM Re: Delete a file that is in use [Re: westor]
RoCk Offline
Hoopy frood

Registered: 16/12/02
Posts: 2009

Delete a file from within mIRC or in Windows?

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

Top
#230364 - 05/03/11 07:05 PM Re: Delete a file that is in use [Re: RoCk]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
I am looking for a command or utility that will work with no setup.
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#230387 - 06/03/11 07:18 PM Re: Delete a file that is in use [Re: westor]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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?



Top
#230393 - 07/03/11 12:22 AM Re: Delete a file that is in use [Re: Tomao]
westor Offline
Hoopy frood

Registered: 27/12/08
Posts: 1511
Loc: Greece
I knew the mIRC command but if a file is in use the mIRC does not delete it and returns an error!
_________________________
Need Online mIRC help or an mIRC Scripting Freelancer? -> http://westor.ucoz.com/contact <-

Top
#230394 - 07/03/11 02:35 AM Re: Delete a file that is in use [Re: westor]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#230397 - 07/03/11 07:12 AM Re: Delete a file that is in use [Re: westor]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.

Top
#230433 - 08/03/11 10:09 AM Re: Delete a file that is in use [Re: westor]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
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"

Top
#230434 - 08/03/11 10:51 AM Re: Delete a file that is in use [Re: argv0]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.

Top
#230435 - 08/03/11 11:16 AM Re: Delete a file that is in use [Re: Tomao]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.


Edited by Riamus2 (08/03/11 11:17 AM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#230436 - 08/03/11 11:20 AM Re: Delete a file that is in use [Re: Tomao]
Horstl Offline
Hoopy frood

Registered: 03/11/06
Posts: 1559
Loc: Germany
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).

Top
#230441 - 08/03/11 07:26 PM Re: Delete a file that is in use [Re: Horstl]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
Thank you two for the reconfirmation.

Top
#230450 - 09/03/11 04:17 AM Re: Delete a file that is in use [Re: Tomao]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
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"

Top
#230455 - 09/03/11 10:31 AM Re: Delete a file that is in use [Re: argv0]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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.

Top