INUSE.exe – Windows CMD Command
Replace files that are currently in use by the OS, requires a reboot.
Inuse is deprecated, and is not guaranteed to be supported in future releases of Windows.
Syntax
INUSE source destination [/y]
Key
source The new/replacement file.
destination The existing file to be replaced.
/y Suppress the confirmation prompt.
/? help
Source and destination must include the complete physical or UNC pathname.
The file will be replaced when the machine is rebooted.
The ‘locked file can be either the source or destination file.
Example
inuse.exe \\serverF4T\install\shiny.dll c:\program files\F4T\shiny.dll /y
Registry
Replacing in-use files, can also be done manually with the REGEDIT registry editor:
Open HKLM\SYSTEM\CurrentControlSet\Control\Session Manager
Double click on
PendingFileRenameOperations
(if it does not exist - create of type REG_MULTI_SZ )
On the first line is the destination file prefixed with \??\
e.g.
\??\d:\backup\trouble.sys
On the second line is the source file to be moved prefixed with !\??\
e.g.
!\??\c:\windows\system32\drivers\trouble.sys
So the complete Multi-String Data would appear like:
\??\d:\backup\trouble.sys
!\??\c:\windows\system32\drivers\trouble.sys
Reboot the machine and the file will be moved and the PendingFileRenameOperations registry key will be deleted.