Results 1 to 4 of 4

Thread: Script to search for and delete all files with extension xxx

  1. #1
    Mike62 Guest

    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!!

  2. #2
    Jacques Trépanier Guest

    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,

  3. #3
    harrykrishna.nospam@online.ie Guest

    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

  4. #4
    Join Date
    Mar 2012
    Location
    UK
    Posts
    1

    Re: Script to search for and delete all files with extension xxx

    Quote Originally Posted by harrykrishna.nospam@online.ie View Post
    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
    problem is, that will also deleted *.tmpl, *.tmplx, *.template etc etc.

Similar Threads

  1. Shell script to add the extension to doc and pdf files
    By Tailor in forum Software Development
    Replies: 4
    Last Post: 24-02-2010, 10:51 PM
  2. Looking for a script to delete files older than 14 days
    By Michael Kapangama in forum Windows Server Help
    Replies: 3
    Last Post: 27-09-2008, 03:56 PM
  3. Script to Search and Delete Files from Remote Machines
    By binuthomas in forum Windows Server Help
    Replies: 24
    Last Post: 20-08-2008, 11:53 PM
  4. Delete files with logoff/on script
    By Pine Le in forum Windows Security
    Replies: 1
    Last Post: 03-06-2008, 11:19 PM
  5. Need a script to delete temporary ASP.NET files
    By Mak66 in forum Windows Server Help
    Replies: 2
    Last Post: 13-02-2008, 07:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,885,673.08090 seconds with 17 queries