Disk Cleanup in Windows Server 2022 to Clean Up C Drive

by John, Updated on: June 5, 2026

Similar to its predecessors, low disk space on the C drive remains a common issue in Windows Server 2022/2025. When this occurs, you can clean up the C drive to reclaim valuable storage. Removing temporary logs, caches, and unnecessary junk files can safely free up space on your system volume. To achieve this, you can utilize either the built-in Disk Cleanup utility or specialized third-party software, though the native Windows utility is fully sufficient to accomplish this task. This article explains how to run Disk Cleanup in Windows Server 2022/2025 to optimize your C drive. If you cannot reclaim enough space through file deletion, it is highly recommended to allocate additional space to the C drive from another partition on the same disk.

How to run Disk Cleanup in Windows Server 2022

There are two standard methods to launch the Disk Cleanup utility in Windows Server 2022/2025:

  1. Open File Explorer, right-click the C drive, and select "Properties." In the pop-up dialog box, click the Disk Cleanup button.
  2. Press the Windows key + R on your keyboard to open the Run dialog, type cleanmgr, and press Enter. The C drive is selected by default, so you can click "OK" to proceed.

Both approaches will open the exact same optimization window.

How to clean up C drive in Server 2022 with Disk Cleanup tool:

  1. Select the checkboxes next to the files you want to delete, then click "OK"..
    Disk Cleanup
  2. Click "Delete Files" in next dialog box to confirm and start deleting.

How to clean up C drive in Windows Server 2022 with command

If you want to run Disk Cleanup in Windows Server 2022 via command, follow the steps below.

Way 1: Automatically select all files with manual confirmation

  1. Press the Windows key + R simultaneously to open the Run dialog box.
  2. Type cleanmgr /LOWDISK and press Enter.
  3. The Disk Cleanup dialog box will appear with all file categories selected by default, allowing you to simply click "OK" to confirm.

Way 2: Automatically clean up all junk files

  1. Press the Windows key + R simultaneously on your keyboard.
  2. Type cleanmgr /VERYLOWDISK and press Enter.

Disk Cleanup will automatically delete all junk files and then display a dialog box showing the results.

Way 3: Automatically clean up specified junk files

  1. Press the Windows key + R simultaneously on your keyboard to open the Run dialog box.
  2. Type cleanmgr /sageset:1 and press Enter. (You can specify any index value from 0 to 65535).
  3. When the Disk Cleanup dialog box appears, select the specific file types you want to delete and click "OK" to save the configuration.
  4. To execute the cleanup, press the Windows key + R simultaneously, type cleanmgr /sagerun:1, and press Enter. The preselected junk files will then be deleted silently without a results window.

In the future, you only need to run cleanmgr /sagerun:1 to clear these files. If you want to manage a different selection of files, type cleanmgr /sageset:2 in step 2 and run cleanmgr /sagerun:2 in step 4.

Extend the C drive if you cannot reclaim sufficient space

If you have never freed up disk space before, you may reclaim over 10GB of capacity on the C drive. However, this is rarely sufficient for long-term server maintenance. New junk files continuously accumulate on the C drive, quickly consuming the newly released space. To prevent the C drive from filling up again in the near future, it is highly recommended to allocate more space from another partition.

By utilizing safe disk partition software, you can shrink another volume on the same disk. This operation releases free space and converts it into unallocated space. You can then merge this unallocated space into the C drive to significantly increase its available capacity. Outperforming other utilities, NIUBI Partition Editor features advanced Virtual Mode, Cancel-at-will, 1-Second Rollback, and Hot-Clone technologies to safeguard your system and data. This allows you to transfer free space to the C drive with zero data loss. All files, applications, and system configurations remain completely intact, with only the partition sizes being adjusted.

Download NIUBI Partition Editor and watch the video tutorial below to extend the C drive safely.

Expand C drive

Beyond resizing partitions in Windows Server 2022/2025 and legacy versions from Server 2003 to 2019, this versatile utility enables you to perform a wide variety of disk partition management operations.

It is highly recommended to expand the C drive as much as your disk capacity allows. To maintain optimal server health, consider the following two additional suggestions:

  1. Avoid installing all applications onto the C drive, and redirect the default download and program output paths to a different partition.
  2. Run the built-in Disk Cleanup utility in Windows Server 2022/2025 on a monthly basis to regularly remove newly generated junk files.