Code: Select all
cd C:\Users\USER\Appdata\Local\Temp
del * /s /q
rmdir /s /q "C:\Users\USER\Appdata\Local\Temp"
As far as I know, rmdir means to remove empty directories. But what if the directory is not empty? Then the Temp folder won't be completely wiped out, since those directories won't be deleted.
I tested the script myself though, by creating a folder in %temp% and a text document inside the folder. I typed
Code: Select all
rmdir /s /q "C:\Users\USER\Appdata\Local\Temp"
But what is the truth behind this? Why is the folder still being deleted?