-
Notifications
You must be signed in to change notification settings - Fork 5
winreagent_cleanup.ps1
Corey Watson edited this page Dec 1, 2025
·
1 revision
Clean up WinRE agent temporary files.
Deletes the C:$WinREAgent folder which contains temporary Windows Recovery Environment update files. This folder can consume significant disk space and is safe to delete after WinRE updates are complete.
Reclaims disk space consumed by temporary WinRE update files on managed Windows endpoints.
- Windows 10/11
- Admin privileges recommended
- FolderPath: Path to WinREAgent folder (default: C:$WinREAgent)
- Deletes folder recursively if it exists
- Hidden/system folder deletion handled
- Checks if C:$WinREAgent folder exists
- If exists, deletes folder and all contents
- Reports result
- No secrets in logs
- Only deletes specified system folder
- 0: Success (folder deleted or not found)
- 1: Failure
[ INPUT VALIDATION ]
--------------------------------------------------------------
Folder Path : C:\$WinREAgent
[ OPERATION ]
--------------------------------------------------------------
Checking for WinREAgent folder...
Folder found, deleting...
[ RESULT ]
--------------------------------------------------------------
Status : Success
Action : Folder deleted
[ SCRIPT COMPLETED ]
--------------------------------------------------------------
- v1.0.0 (2025-11-29): Initial Style A implementation
- View Script Source
- Scripts - Back to script index