Temporary Files in Windows 8.1

My temporary files are constantly piling up. When I went to bed one night, I had 523 GB free on my main drive. When I got up, I had 259 GB of space. I wrote a script to see what was taking up all that space, and it was temporary files. I wrote a script to delete them, and I have to run it everyday because they pile up so fast. How can I stop them from piling up like that?

Go to "This PC" right click your main drive (C:) and click "Disk Clean-up"

Have a look at the space being used there and hit clean up if the values are too high. Windows 8.1 and Windows 8 should use about 1 - 2Gb with average use (including gaming) however if you use the machine for development this value can be higher.

It also depends on what type of disk you have, Windows 8 will use a lot less in temp if you have an SSD.