fortypoundhead.com

MV.exe (Resource Kit)

Posted On 2005-11-1 by FortyPoundHead
Keywords: Command Reference
Tags: Windows Commandline Windows
Views: 2200


MV.exe (Resource Kit)



Move File - Copy a file to another location even if the file is in use (Locked)





syntax

MV /x /d d:\temp\ntfs.sys C:\winnt\system32\drivers\ntfs.sys



key

The first file name is the file to be copied and the second

the destination pathname.



/d : does not copy the file until reboot time

allows in-use files to be replaced



/x : Prevents the default action that will otherwise create a

folder called "deleted" containing a copy of the

original file.

Note that you must use a FULL pathname to each file.



The NT resource kit contains 2 versions of MV.EXE - a posix version and a Windows NT version - they are not the same!



The /d option is not available with the posix version of mv, but if you prefer, you can do a file replace at boot time by manually updating the registry (which is all MV.exe does)



Start the registry editor (regedt32.exe not regedit.exe)



Move to HKLM\SYSTEM\CurrentControlSet\Control\Session Manager



Double click on

PendingFileRenameOperations

(if it does not exist - create of type multi_str )



On the first line is the name of the new file with \??\ in front,

e.g.

\??\d:\temp\ntfs.sys



On the second line is the file to replaced with !\??\ in front,

e.g.

!\??\c:\winnt\system32\drivers\ntfs.sys



Click OK





So the complete Multi-String Data would appear like:



\??\d:\temp\ntfs.sys

!\??\c:\winnt\system32\drivers\ntfs.sys



Once the reboot is complete and the file replaced the PendingFileRenameOperations value will be deleted from the registry






About the Author

FortyPoundHead has posted a total of 1974 articles.


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.82.56.95

Before you can post, you need to prove you are human. If you log in, this test goes away.




Recent Forum Posts

Advanced search added
dwirch posted on September 23, 2017 at about 13:44 in Site News

Job Spammer: Gaurav Mehta - AgreeYa Solutions
dwirch posted on September 22, 2017 at about 10:35 in Spammers

Job Spammer: Prutha Siri - Javelin Systems
dwirch posted on September 10, 2017 at about 6:15 in Spammers

New security implemented
dwirch posted on September 7, 2017 at about 7:16 in Site News

Malicious IP Checker Companion Tool
dwirch posted on August 12, 2017 at about 20:24 in Site News

Job Spammer: Steve Adams
dwirch posted on August 8, 2017 at about 7:44 in Spammers