Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


cleanup.bat wildcard question

  • Please log in to reply
No replies to this topic

#1 mysticduck


  • Members
  • 35 posts
  • Gender:Male
  • Location:Southern Oregon
  • Local time:04:40 PM

Posted 13 February 2009 - 12:45 PM

I have a cleanup file I run when I am done working on a clients computer which reads as follows

if exist %temp% del %temp% /f /s /q /a :h
if exist %temp% rmdir %temp% /q /s
if exist %systemroot%\temp del %systemroot%\temp /f /s /q /a :h
if exist %systemroot%\temp rmdir %systemroot%\temp
defrag c: -b
defrag c:
shutdown /s /f /t 0[/codebox]

This method only deletes the temp files in the current users profile. I am wondering if there is a way to do something like
[codebox]if exist c:\documents and settings\*\temp del c:\documents and settings\*\temp *.* /f /s /q /a :h[/codebox] so that no matter what profile names the client might have, all temp files would be deleted. Any help would be appreciated, and feel free to use and adapt this for personal use.
Stultorum infinitus est numerus

BC AdBot (Login to Remove)


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users