开发者

Batch program to delete files with different extentions

开发者 https://www.devze.com 2022-12-12 18:07 出处:网络
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.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消