Sunday, October 23, 2011

Tips: How to use MoveFile and PendMoves to move or delete a file that is always in use

If any of the files is in use by the operating system, usually it can’t be moved. Therefore, if any file is constantly in use, you can schedule Windows Vista to move the file during the startup using the MoveFile tool. It is available free for you here. You can use the MoveFile tool exactly like you see the Move command as shown below.

movefile file.txt test\file.txt
Movefile v1.0 - copies over an in-use file at boot time
Move successfully scheduled.

If you do this, the file won’t be moved immediately. However, if the computer is restarted next time, Windows will move the file. At the same time, if you wish to delete a file that is constantly in use (a common requirement for removing malicious software), provide "" as the destination. For example:
movefile file2.txt ""

 
Movefile v1.0 - copies over an in-use file at boot time
Move successfully scheduled.


The same download that includes MoveFile includes the PendMoves command, which displays moves and deletions that have been scheduled. You can simply run the command without parameters, as the following example demonstrates:
pendmoves
PendMove v1.1
Copyright (C) 2011 Mark Russinovich
Sysinternals - wwww.sysinternals.com
Source: C:\Users\User1\Documents\file.txt
Target: C:\Users\User1\Documents\dest\file.txt
Source: C:\Users\User1\Documents\file2.txt
Target: DELETE
Time of last update to pending moves key: 10/23/2011 10:08 AM

B y ,