Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



Script to search for and delete all files with extension xxx

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-11-2006
Mike62
 
Posts: n/a
Script to search for and delete all files with extension xxx

I need a script to delete files with a extension of tmp, temp, and dmp.

This is probably really simple, I'm new to scripting.

also i need it to search just the local drives, no mapped drives.

Thanks in advance!!
Reply With Quote
  #2  
Old 23-11-2006
Jacques Trépanier
 
Posts: n/a
Re: Script to search for and delete all files with extension xxx

Create a file call DEL-xyz.cmd with notepad and enter the following:

@echo off
for /f "tokens=*" %%j in ('dir /B /s *.tmp') do del /Q "%%j"
for /f "tokens=*" %%j in ('dir /B /s *.temp') do del /Q "%%j"
for /f "tokens=*" %%j in ('dir /B /s *.dmp') do del /Q "%%j"

And run it from the directory you wnat to clean up. it can be from the root
of a drive.

Have fun!

Jacques,

"Mike62" <Mike62@discussions.microsoft.com> a écrit dans le message de news:
EEEDD4B5-B2B2-4E80-A467-B7C3B726147B@microsoft.com...
>I need a script to delete files with a extension of tmp, temp, and dmp.
>
> This is probably really simple, I'm new to scripting.
>
> also i need it to search just the local drives, no mapped drives.
>
> Thanks in advance!!



Reply With Quote
  #3  
Old 25-11-2006
harrykrishna.nospam@online.ie
 
Posts: n/a
Re: Script to search for and delete all files with extension xxx

I know this works in XP so it may be worth looking at.

Go to the root of the drive

C:

then type

del /s *.tmp *.temp *.dmp

For more info type del /?

HTH



"Jacques Trépanier" <zx_jacques@hotmail.com> wrote:

>Create a file call DEL-xyz.cmd with notepad and enter the following:
>
>@echo off
>for /f "tokens=*" %%j in ('dir /B /s *.tmp') do del /Q "%%j"
>for /f "tokens=*" %%j in ('dir /B /s *.temp') do del /Q "%%j"
>for /f "tokens=*" %%j in ('dir /B /s *.dmp') do del /Q "%%j"
>
>And run it from the directory you wnat to clean up. it can be from the root
>of a drive.
>
>Have fun!
>
>Jacques,
>
>"Mike62" <Mike62@discussions.microsoft.com> a écrit dans le message de news:
>EEEDD4B5-B2B2-4E80-A467-B7C3B726147B@microsoft.com...
>>I need a script to delete files with a extension of tmp, temp, and dmp.
>>
>> This is probably really simple, I'm new to scripting.
>>
>> also i need it to search just the local drives, no mapped drives.
>>
>> Thanks in advance!!

>



Ha®®y

HarryKrishna.nospam@online.ie
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Script to search for and delete all files with extension xxx"
Thread Thread Starter Forum Replies Last Post
Shell script to add the extension to doc and pdf files Tailor Software Development 4 24-02-2010 10:51 PM
Looking for a script to delete files older than 14 days Michael Kapangama Windows Server Help 3 27-09-2008 04:56 PM
Script to Search and Delete Files from Remote Machines binuthomas Windows Server Help 24 21-08-2008 12:53 AM
Delete files with logoff/on script amir Windows Security 4 20-06-2008 08:09 AM
Need a script to delete temporary ASP.NET files Mak66 Windows Server Help 2 13-02-2008 07:00 PM


All times are GMT +5.5. The time now is 06:41 PM.