Cleanup & Disable Offline Files

Modified on Thu, 1 May at 2:03 PM

# Disable Offline Files
Invoke-Command -ScriptBlock {
    Start-Process -FilePath "cmd.exe" -ArgumentList "/c sc config cscservice start= disabled" -Verb RunAs
    Start-Process -FilePath "cmd.exe" -ArgumentList "/c sc stop cscservice" -Verb RunAs
}

# Clear CSC Cache on next reboot
Invoke-Command -ScriptBlock {
    New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\CSC\Parameters" -Name "FormatDatabase" -Value 1 -PropertyType DWord -Force
}

Run in Admin PowerShell:


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article