How To Quickly Free Up Disk Space on a Terminal Server
If you’ve found this article, then you are experiencing the same issue on your terminal server as I have. When you have a terminal server with a lot of users, the downloads folder and recycle bin quickly fill up with unneeded documents as users work throughout the day. Here are a couple quick commands you can run to quickly free up space on your terminal server.
Empty the Recycle Bins for All Users
Log onto your HyperV server and go to the settings of your VM, then click on Integration Service. Uncheck Time synchronization.
- Launch elevated Prompt. To do this, type CMD in the Start menu search box, right click on the Common Prompt and then click Run as administrator.
-
Type the following command:
rd /s c:\$Recycle.Bin
(In the above command, “c” is your Windows drive)
Press the Enter key.
- Press Y key to confirm and empty Recycle Bin.
- Type Exit and press the Enter key again to close the Prompt.
Powershell Script to Delete Download Folder Contents for All Users
- Open Powershell with elevated permissions.
- Run the following command to delete the contents of ALL users downloads folder:
All Users:
Get-ChildItem C:\Users\*\Downloads\* | Remove-Item -recurse -forceSingle User (Replace Administrator with your desired Username):
Get-ChildItem C:\Users\Administrator\Downloads\* | Remove-Item -recurse -force
Powershell Script to Delete All Users Temp Files
Get-ChildItem -Path ‘C:\Users’ | foreach { Get-ChildItem -Path “$($_.FullName)\AppData\Local\Temp” -ErrorAction Ignore | Remove-Item -recurse -force }
Home » How To Quickly Free Up Disk Space on a Terminal Server