|
| |||||||||
| Tags: delete, extension, script, xxx |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| 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
| |||
| |||
| 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!! |
|
#3
| |||
| |||
| 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 |
![]() |
|
| Thread Tools | Search this Thread |
| |
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 |