DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Windows NT / 2000 / XP (http://www.daniweb.com/forums/forum10.html)
-   -   Creating a batch file to clear out Temp files (http://www.daniweb.com/forums/thread73675.html)

digitalrebel11 Mar 28th, 2007 3:03 pm
Creating a batch file to clear out Temp files
 
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

iamthwee Mar 28th, 2007 3:07 pm
Re: Creating a batch file to clear out Temp files
 
yes, use quotes

george ghanem Jun 8th, 2008 3:32 pm
Re: Creating a batch file to clear out Temp files
 
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.

Quote:

Originally Posted by digitalrebel11 (Post 335718)
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



All times are GMT -4. The time now is 12:47 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC