After upgrading to Windows 10, you might notice two hidden folder $Windows~BT和$Windows~WS consumes more than 10GB spaces of C drive. These two folders are created for Windows 10 upgrade and can be safely removed after successful upgrade. However, if you run build in Disk Cleanup tool on Windows 10, it only cleans up Windows.old folder, and does not touch $Windows~BT and $Windows~WS. Following are scripts which you can manual clean up these two folder.

Clean up $Windows~BT

takeown /F C:$Windows.~BT* /R /A
icacls C:$Windows.~BT*.* /T /grant administrators:F
rmdir /S /Q C:$Windows.~BT

Clean up $Windows~WS

takeown /F C:$Windows.~WS* /R /A
icacls C:$Windows.~WS*.* /T /grant administrators:F
rmdir /S /Q C:$Windows.~WS