After a short PM exchange with
sixpack, I thought I had better explain something.
The single line commands I gave are not for use in a batch file. They are to be entered into a command prompt window. If you haven't set your command prompt options for, right click paste and /or tab completion, you can also enter them into the
Start »
Run box after first typing '
cmd /c '
Now if you wish to test the file for what will be deleted, instead of possibly removing directories you didn't mean to using the
Start »
Run box as above, you will want to keep the window open, to see your results. To do this type '
cmd /k ' first, instead of '
cmd /c '. All I have added to the commands below is '
@echo ', when your through with testing remove that and revert to the '
cmd /c ' prefix.
cmd /k for /d %g in (%temp%\*) do @echo rd /s /q "%g"
cmd /k for /d %g in ("%windir%\Downloaded Installations\*") do @echo rd /s /q "%g"
I hope this helps!
Additional note
I have also added something which I had omitted in my earlier examples, the quotes around the %g at the end, this will be necessary for any directories with spaces anywhere in their path names