Computing.Net > Forums > Programming > Batch File Question - Newbie

Batch File Question - Newbie

Reply to Message Icon

Original Message
Name: nickh21
Date: June 28, 2007 at 09:45:26 Pacific
Subject: Batch File Question - Newbie
OS: Windows XP
CPU/Ram: n/a
Model/Manufacturer: Dell
Comment:

Hello all! Quick newbie question!

I am stuck deleting files in certain temp directories daily, and would like to know how to create a batch file to do this.

Basically I need to delete a few "folder\files in folder".

I don't want to answer Y every time either. I've tried, tried, tried, and failed to make one from instructions off google.

Please help!
Thanks much!



Report Offensive Message For Removal


Response Number 1
Name: tonysathre
Date: June 28, 2007 at 14:48:35 Pacific
Reply: (edit)

@echo off
del /q c:\temp\*.* > nul

You can add more directories by adding the
del /q drive:\dir\*.* on another line.

"Computer security." — Oxymoron


Report Offensive Follow Up For Removal

Response Number 2
Name: nickh21
Date: June 29, 2007 at 05:10:02 Pacific
Reply: (edit)

What about the local settings temp?

Would it be del/q %tmp%\*.*?

Thanks!


Report Offensive Follow Up For Removal

Response Number 3
Name: tonysathre
Date: June 29, 2007 at 11:01:12 Pacific
Reply: (edit)

That would work as well. There are two of them actually: %temp% and %tmp%. They both point to the same directory.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch File Question - Newbie

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge