I’ve already written a PowerShell Script to perform this task. Search for it within this blog. Meanwhile, here are some lines to demonstrate the manual process of getting this done.
a. Seize ownership of filetakeown /f %WINDIR%\system32\{filename}
b. Grant Administrators accessicacls %WINDIR%\system32\{filename} /GRANT ADMINISTRATORS:F
c. Replace corrupted file with a known good copyCOPY SOURCE_FILE %WINDIR%\system32\{filename}
Categories: