Home > other >  How do I run disk cleanup for system files on C Drive in the Powershell command line?
How do I run disk cleanup for system files on C Drive in the Powershell command line?

Time:04-29

The title pretty much says it all. I'm trying to create a policy for an assortment of devices being monitored. I want to, specifically, run the disk cleanup that you can find in a drive's properties window.

Windows C Drive Properties

I'd want it to also check the system files for anything that can be deleted like you can after disk cleanup finishes scanning the drive.

Disk Cleanup C Drive

I'm not terribly familiar with commands for the powershell command line (the program I'm using to create the policy, however, uses it specifically) so please be kind and explain as you would to a beginner. Also, if what I want to do simply isn't possible, please let me know. As you can imagine, I'm not terribly versed in what is or isn't possible with Powershell.

CodePudding user response:

You're wanting to use cleanmgr.exe and one of it's many switches.

You can do something like cleanmgr.exe /SAGESET:number or cleanmgr.exe /verlowdisk

  • Related