Change files on reboot

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 :

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager

-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

Type this:

 \??\D:\Somefolder\shell32.dll !\??\C:\Windows\system32\shell32.dll

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:


  • Rakila

    Good tutorial bro 🙂 thanx for sharing…!!

    • iammrblade

      Your most welcome 🙂