Techware Labs Header

Forums have moved

See this announcement for more details, or just go directly there.

  #1  
Old 08-08-2007, 02:14 PM
agita agita is offline
Junior Techie
 
Join Date: Aug 2007
Posts: 1
Default Batch File Help

Hello this is my first post, don't want to irritate so i'll jump to the point.

I'm looking for some help with creating a batch file.

I want to delete multiple files, but just to keep it simple i will say one.

If i want to delete my temp files from the temp folder in windows ie.

C:\WINDOWS\Temp\

How do I delete everything in the folder but not the folder itself?


EDIT:

Answered my own question

del /s C:\WINDOWS\Temp\*

I kept deleting the entire folder lol.

Last edited by agita : 08-09-2007 at 10:52 AM.
Reply With Quote
  #2  
Old 09-03-2007, 04:21 PM
Omega Omega is offline
Administrator
 
Join Date: Nov 2001
Location: Minneapolis, MN, USA
Posts: 957
Send a message via ICQ to Omega Send a message via AIM to Omega Send a message via MSN to Omega Send a message via Yahoo to Omega
Default

Yup. Alternatively, if you wanted a more 'scripty' way to accomplish it, you could:
Code:
for %i in (c:\WINDOWS\Temp\*) do del %i
As a side note, I like to test scripts like this prior to actually running them, by doing something along the lines of:
Code:
for %i in (c:\WINDOWS\Temp\*) do echo %i
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:52 PM. Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Forum style by ForumMonkeys.