Subscribe

Get the Network Administrators tool pack

Subscribe to our newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them.

Click Here to get your free tools

Recent Posts

Search

Archives

Move or delete files that are always in use

Post image for Move or delete files that are always in use

by Steve Wiseman on September 1, 2011 · 9 comments

in Tips,Tools,Utility


.

Once in a while you will come across a file that you can’t move or delete because it is always in use.

A trick to get around this is to have Windows delete or move it on startup – before the system is running and the file is back in use again.

How can you tell Windows to do this?

With a free tool from Microsoft.

It is called MoveFile, and you call it like this from the command line:

movefile c:\temp\source.txt c:\temp\dest.txt

This would move the file source.txt to dest.txt on the next reboot

If you wanted to delete the file, simply provide an empty destination:

movefile c:\temp\source.txt ""

Windows will quietly remove it during the next reboot.

Included in the download is a utility called “PendMoves”. This little app will let you know what moves are pending:

Sysinternals - wwww.sysinternals.com

Source: C:\temp\source.txt
Target: C:\temp\dest.txt

Time of last update to pending moves key: 9/1/2011 1:47 AM

Both utilities are free for personal and commercial use, and can be downloaded from here:

http://technet.microsoft.com/en-us/sysinternals/bb897556.aspx

One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools

Related Articles:

{ 9 comments… read them below or add one }

1 Jen September 6, 2011 at 11:25 pm

Thanks for the tip steve. Just used this to help remove a virus. As always, keep it up.

2 Steve Wiseman September 6, 2011 at 11:26 pm

Glad I could help 🙂

3 Dave September 7, 2011 at 8:15 am

Interesting tool. Does this work with Windows 2000?

4 Steve Wiseman September 7, 2011 at 8:16 am

Sure does. No problems with 2000 through Windows 7 and 2008

5 Dan Molnar September 23, 2011 at 9:57 am

A “better” way if you have Professional (XP, Vista, 7) (home edition does not work unless your in safe mode) is to right click on the file and remove the security, remove all users etc system and put disable all. After reboot the file is not allowed to open, but you can delete it. Some programs out there do this, but in my experience not all of the work and the ones that do, don’t work all the time. This method has NEVER failed me. And I remove a lot of viruses and malware from friends, family, etc.

6 Steve Wiseman September 23, 2011 at 11:33 am

Thanks Dan, that is an excellent tip. I will have to try that next time.

Steve

7 Paul October 4, 2011 at 7:14 am
8 Steve Wiseman October 4, 2011 at 9:58 pm

Thanks for the link Paul – Just for anyone else reading this and going to the emptyloop site – It can be difficult to find that download link….lots of links to other adware downloads. Find the actual download by looking for the MD5 and the full version number of the app (Download Unlocker 1.9.1 – 32 bit version MD5: 70cdf58c761ded85d6d15884281974fc)

Just do a search for ‘MD5’ on the page…and it will get you right to the download link. Don’t know how many times I accidentally downloaded that ADL add-on.

9 Bryan Price October 12, 2011 at 8:35 pm

Fascinating. I already had this program in my toolkit. I had forgotten what it did. My usual tool for this, dellater, decided that it couldn’t find the file for some reason. 🙁

Leave a Comment

Category Links - Windows Forum - Exchange Forum