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!
Delete a file from within mIRC or in Windows?
Try this
http://unlocker.emptyloop.com/
I am looking for a command or utility that will work with no setup.
According to the help file:
/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.Delete a file from within mIRC or in Windows?
I knew the mIRC command but if a file is in use the mIRC does not delete it and returns an error!
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.
You can try this by entering the command via mIRC:
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.
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.
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.
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.
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).
Thank you two for the reconfirmation.
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.
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.