You might have came across the situation that you want to delete a file but it’s in use so you can’t! I have a solution to that which I would like to tell you, it’s useful and pretty simple though.
All you gonna need is regedit.exe
Let’s say you want to delete a file say shell32.dll which is located at C:\Windows\System32
-Just open regedit.exe from Run. Navigate to :
-Create a new value PendingFileRenameOperations of type REG_MULTI_SZ (Multi string value)
Just this! What this will do is delete shell32.dll from C:\Windows\System32 the next time you restart your windows.
If you want to add one more schedule then just enter 2 blank lines and type a new command just like above.
Just like you delete the files you can also change the files on restart.
Consider you want to change shell32.dll in C:\Windows\System32 on next reboot with Shell32.dll located at D:\Somefolder
In case you don’t like typing the whole thing in regedit then you can also use a software Movefile by sysinternals.
Download link for movefile.
Have a look at my PendingFileRenameOperations: