0

Problem:

A lot of older workstations on our networks are running out of hard disk space and I am looking for ways to stream-line the process of cleaning up some space. I understand I can use Disk Clean-up to do this but that requires logging on and running it manually, which can take some time for the amount of workstations we have in our environment.

Solutions I have tried:

I have already setup GPOs for Storage Sense to remove temporary files, downloads etc. but one of the larger folders is the Windows.old directory.

I found the following script using disk clean-up:

cleanmgr.exe /SAGERUN:0

But this requires me run it as the user itself and we do not have admin permissions for standard users. It also still requires user intervention to choose the folders that are deleted with disk-clean up.

Solution I am seeking:

I am looking for a script I can run via PDQ Deploy to clean-up the Windows.old directories on workstations, something I can run without any user input.

1 Answers1

0

Thanks to @PeterHahndorf for the solution for removing the Windows.old folder. I also needed to be able to remove "previous windows installations" and found a thread on StackOverflow which helped me resolve that problem.

All the details I needed for using cleanmgr remotely were found in stack overflow in thread: Stack Overflow Cleanmgr Script Thread