943,866 Members | Top Members by Rank

Ad:
Mar 28th, 2007
0

Creating a batch file to clear out Temp files

Expand 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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
digitalrebel11 is offline Offline
1 posts
since Mar 2007
Mar 28th, 2007
0

Re: Creating a batch file to clear out Temp files

yes, use quotes
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Jun 8th, 2008
0

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.

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
george ghanem is offline Offline
1 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Windows NT / 2000 / XP Forum Timeline: SATA RAID Drivers / XP wont boot
Next Thread in Windows NT / 2000 / XP Forum Timeline: Black screen when windows boots up (unique!)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC