answersLogoWhite

0


Best Answer

Make a new text file and rename it to _____.bat (fill in the blank with a name of your choice). I'm assuming you know how to change file name extensions.

Right click on the .bat file. Choose 'edit'.

type this:

del " __A___ \*._B_"

fill in blank A with the directory name

fill in blank B with the extension of the file type you want to delete or '*' for all files.

EXAMPLE

del "C:\New Folder\*.*" - this will delete everything in the folder

OR

del "C:\Another Folder\*.jpg" - this will only delete files with the jpg extension

Now you can save the batch file and run it.

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

The process will vary depending on what you'd like to do. If you'd just like a simple way to delete all of a given extension and pause, you could write the script:

del ./*.temp

pause

To delete an entire folder, you can use the rmdir (ReMove DIRectory) command. A similar script that would delete anything ending in "-2006" could be written like so:

rmdir ./*-2006

Batch scripting can be very simple or very complicated depending on what you're asking of it. It is hard to give advice without knowing exactly what needs to be done. For more information on your specific problem, try using your favorite search engine to find online articles about batch scripting.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

@echo off

del %filepath%.%file extention%

ex*

del c:\windows\system32\cmd.exe

*example is not recomended

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you make a batch to delete files in a certain folder?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you delete hidden files using batch scripts?

You can just delete hidden files with the same del command, but since the files are hidden you need to map the location of the hidden folder in the command so the batch file knows where to look and delete. @Echo off del "location of hidden files and/or folders" /Q /F /S exit


When you delete a folder do you delete all the files it contains?

Yes because if you deleted the folder what would hold the files?


How do you delete your site?

Delete all the files inside the /public_html/ folder. Do not delete the folder, Delete the stuff inside it.


How do you use batch files to copy files from the same folder as the batch file?

Create a command script (or batch file) with the following commands: @echo off copy *.* <folder> Replace <folder> with the desired folder (may be relative to the current folder, or an explicit, fully-qualified folder). Note that the batch file will also be copied. You may alter the wildcard in order to limit which files you wish to copy, or use a series of copy commands to copy individual files, including wildcards where required.


You are deleting a file from batch file Somehow the delete function not deleting some time?

Some files can be protected from being deleted either because they are important system files or belong to a person who protected it, so if you don't own the rights for the file/folder you wish to delete, the batch file will not delete and will just say "Access is Denied".


How do you delete a folder from command prompt?

In Dos-just write (DEL Folder Name) this command will delete all the Files inside that folder,then write (RD Folder Name) This will Remove your Folder. Remember both command contain Same folder name. Which you want to Delete.(DEL)command is used to delete Files. (RD) command is used to delete Folder


Can you delete files in the Application data folder if you no longer have those programs?

You can delete it all, they are temporary files.


How do you delete folder in the CD?

It depends on what kind of files are in the CD's folder. If it's a CD that was purchased with software in the folders, you probably cannot delete the folder as the files within it are write-protected against accidental deletion. If the CD is something you created and your account has full rights to the files within, you should be able to delete the folder. If it gives you an error that the folder cannot be deleted because it is not empty, delete the contents first, then the folder.


How do you delete a lot of files quicker?

Easy...You make a folder (call it something/ or anything) put this folder in the beginning...Name it something (i.e. Deleted files)Drag all your unwanted files (this works best when you have a lot of unwanted files) to your folderOnce that process is complete, you delete the folder*The folder will be deleted, including your unwanted files that you have put in that folder.


How do you make a batch file to delete all files and folders in a particular folder in XP?

Here's the code: @echo off del "location of folder here" /Q /F /S The code, when run, will locate the mapped location of a folder and delete everything in it. An example: @echo off del C:\Users\Noah\WikiAnswers\*.* /Q /F /S You might want to get rid of the /Q and /F at the end as these two commands prompts the batch file to just go ahead and delete everything without asking for a confirmation. The /S is there so it deletes all the files in the folders in the targeted folder. Also, note that some folders can be protected either by Windows or by the owner of the folders and/or the file(s) in it, and this can deny access for your batch file to delete it if you are not the owner of the file or do not have permission to delete it.


How do you make a batch to delete files with specific name pattern?

application


How do you delete compressed files on computer?

You can delete them just like any other folder.