1.

Solve : Clear Temps Batch File?

Answer»

I created a clear temps batch file consisting of something along the LINES of...

Code: [Select]
@echo off
del %userprofile%\Local Settings\Temp\*
del %userprofile%\Local Settings\Application Data\*
del %userprofile%\Local Settings\History\*
del %userprofile%\Local Settings\Temporary Internet Files\*
exit

It doesn't work, and I think it doesn't like the *'s. What can I put to DELETE everything in specified directory?


You might try using quotes as the PATHS have embedded spaces.

Code: [Select]@echo off
del "%userprofile%\Local Settings\Temp\*"
del "%userprofile%\Local Settings\Application Data\*"
del "%userprofile%\Local Settings\History\*"
del "%userprofile%\Local Settings\Temporary Internet Files\*"
exit

The above code will work for files. Directories are another matter...use the rd COMMAND for them with the /s switch. Add the /q switch for no user intervention.

Good luck. 8-)
Thanks. 8-)



Discussion

No Comment Found