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


MV-Windows Command

MV

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

Syntax
      MV /x /d source destination

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

Other Windows 98, Windows XP Commands:
addusers , arp , assoc , associate , at , attrib , browstat , cacls , call , cd , change , chkdsk , chkntfs , choice , cipher , cleanmgr , clip , cmd , color , comp , con2prt , copy , date , defrag , del , delprof , dir , diruse , diskcomp , diskcopy , doskey , dsadd , dsmod , echo , endlocal , exit , expand , expand , fc , fdisk , find , findstr , for , forfiles , format , fsutil , ftp , ftype , global , goto , help , hfnetchk , if , ifmember , ipconfig , kill , label , ldifde , local , logevent , logoff , logtime , mapisend , md , mem , mode , monitor , more , mountvol , move , moveuser , msg , msiexec , msinfo32 , mstsc , munge , mv , nbtstat , net , netdom , netsh , netstat , netsvc , now , nslookup , ntbackup , ntrights , path , pathping , pause , perms , ping , popd , portqry , print , prncnfg , prnmngr , prompt , pushd , qgrep , rasdial , rasphone , rd , rdisk , recover , reg , regedit , regsvr32 , rem , ren , replace , rmtshare , robocopy , route , runas , rundll32 , sc , schtasks , sclist , scriptit , set , setlocal , setx , share , shift , shortcut , showgrps , showmbrs , shutdown , sleep , soon , sort , start , su , subinacl , subst , tasklist , time , timeout , title , touch , tracert , type , ver , verify , vol , where , whoami , windiff , winmsd , winmsdp , wmic , xcacls , xcopy ,
Live2Support.com :
Product - Benefits - Features - How Does it Works - Pricing - SSL Certificates - Signup - Contactus - Login - Submit Resources