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

Sponsored Links



Creating a batch file to find and delete certain files

TroubleShoot 98


Reply
 
Thread Tools Search this Thread
  #1  
Old 02-06-2009
Member
 
Join Date: Jul 2006
Posts: 191
When I go into a folder on my computer, lets say C:\Temp, then I can see that it everytime fills up with too many .tmp word files and I have to manually open it everytime and delete all the files. Same is the case with the .tmp files when I search it. Therefore I was wondering if I can make some bat file that will automatically delete all the files from those folders? How do i create such batch file, any help would be appreciated.

Reply With Quote
  #2  
Old 30-07-2009
Member
 
Join Date: Sep 2005
Posts: 226
Follow the below command to delete files by using the bat files:
  1. You will need to first of all open a notepad.
  2. After that you will have to type in the following code:
    Code:
    @echo off
    deltree C:\Directory you want to delete /s for quietly
  3. Save the same file as deletetmpfile.bat
  4. Double click on the same bat file to delete all the tmp files automatically.

So basically you just need a text file like notepad and then write the code which is stated above and save it as a .bat file.
Reply With Quote
  #3  
Old 10-01-2014
Member
 
Join Date: Apr 2009
Posts: 448
Re: Creating a batch file to find and delete certain files

Try using a batch file creator software. There are few of them available on the web. This tool help you to create a batch file through which you can do whatever you want. I had used this long before to create a batch file which can move all my folders to a new directory. Batch File Creator is a simple tool to use. There are basic as well as advance tools that you can use for creating batch file. So better check before downloading a software. You can check the functionality it offers or else you wont get the kind of output you are looking for.
Reply With Quote
  #4  
Old 11-01-2014
Member
 
Join Date: Apr 2009
Posts: 732
Re: Creating a batch file to find and delete certain files

You can do the same through a third party software also. If your system has too many duplicate files you can try using a Duplicate file finder. You can run the same to delete files from your system. Free Duplicate File Finder is one of the best that you can use. It is free and works really nicely. You just have to run the tool and it will scan the system for duplicate file. It gives you simple comparison process also. You can choose files which are additional and delete the same. This is also a time saving process. It is more reliable compare to batch file.
Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > TroubleShoot 98
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Creating a batch file to find and delete certain files"
Thread Thread Starter Forum Replies Last Post
Creating a Batch file in order to add a website as a wallpaper in Windows Xp? BSOD.K Customize Desktop 4 03-04-2012 06:31 PM
Create a batch (. Bat) MS-DOS to delete files Aarya Software Development 9 08-09-2011 12:58 AM
Need batch file to delete user files in Windows XP mcamp32 Windows XP Support 1 26-05-2011 10:54 PM
Creating a batch file to launch programs based on time rblanda Tips & Tweaks 3 31-12-2009 09:19 PM
Batch file to delete files dynamically freelancer24 Windows Server Help 3 08-02-2009 01:33 AM


All times are GMT +5.5. The time now is 09:00 PM.