This can help you avoid tracking down users or having to install unnecessary utilities on your system.
Setup and Usage
The script can be placed anywhere on your system.
The script will continuously make a run at delete the old file while waiting several seconds in between tries.
SETLOCAL EnableExtensions
REM Validation.
REM Log off prompt.
If you do not want to see this, you’re able to delete these lines.
ECHO Automatically log off once the replace process has completed?
ECHO Enter ‘Y’ to automatically log off or enter anything else to not.
ECHO The Old File is still locked.
Waiting a few moments to retry.
ECHO Stopping without doing anything.
Press any key to close.
ECHO You will be logged off shortly.
SHUTDOWN /L
ENDLOCAL
Links
Download ReplaceFile Script from SysadminGeek.com