Batch program to delete files with different extentions
I would like to know how to write a batch file that will delete files with extensions iden开发者_JAVA技巧tified by the user, so the code will need a user input parameter capability. Anyone know of an existing one or how I should approach this?
If you're using WIndows, PowerShell can do this.
get-children -Filter *.whatever | delete
Not sure of the syntax here. You'll have to check it out.
You can also use del *.whatever /s from the command line.
I think I have the key to your question!
DEL "C:\(you can select specific file path here)*(here is the part you put what extension to move)*"
This should work, if not then tell me the error message, and i will be happy to help.
@echo off
del *.txt
Save this in deltext.bat
, and all the .txt
files will be deleted in that directory. If you wanna delete .3gp
files then write:
del *.3gp
精彩评论