Creating a batch file to clear out Temp files

Reply

Join Date: Mar 2007
Posts: 1
Reputation: digitalrebel11 is an unknown quantity at this point 
Solved Threads: 0
digitalrebel11 digitalrebel11 is offline Offline
Newbie Poster

Creating a batch file to clear out Temp files

 
0
  #1
Mar 28th, 2007
Hello,

I'm trying to create a batch file that will delete & remake temporary directories, but it isn't working. There are two directories that I want to do this two, and the second one doesn't work. here is the code:

@echo off
rd c:\windows\TEMP /s /q
md C:\windows\TEMP

rd C:\Documents and Settings\christ\Local Settings\Temp /s /q
md C:\Documents and Settings\christ\Local Settings\Temp

Are the spaces in the directory the problem? If so, how do i fix it?

Thanks,
Chris
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,264
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 376
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Creating a batch file to clear out Temp files

 
0
  #2
Mar 28th, 2007
yes, use quotes
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 1
Reputation: george ghanem is an unknown quantity at this point 
Solved Threads: 0
george ghanem george ghanem is offline Offline
Newbie Poster

Re: Creating a batch file to clear out Temp files

 
0
  #3
Jun 8th, 2008
This will work as long as the TEMP dir is empty or it is not locked by another process.
Any solution for such scenario? I have "BITxx" files (where xx are random digits) that keep multiplying and growing in the TEMP dir. I can delete ALL of them except for ONE. Once I do that, I see more files being recreated. Please advise.

Originally Posted by digitalrebel11 View Post
Hello,

I'm trying to create a batch file that will delete & remake temporary directories, but it isn't working. There are two directories that I want to do this two, and the second one doesn't work. here is the code:

@echo off
rd c:\windows\TEMP /s /q
md C:\windows\TEMP

rd C:\Documents and Settings\christ\Local Settings\Temp /s /q
md C:\Documents and Settings\christ\Local Settings\Temp

Are the spaces in the directory the problem? If so, how do i fix it?

Thanks,
Chris
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Windows NT / 2000 / XP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC