Win7系统如何用批处理命令删除文件?
时间:2023-12-09 02:47:54
平时我们删除文件的时候都时按键盘上的DEL键或者是SHIFT+DEL组合键来删除的。这比较麻烦,其实在Windows下bat批处理,自动获取文件的最后修改时间,然后将指定多少天之前的文件删除,需要Windows支持forfiles命令,下面,小编给大家分享Win7批处理命令删除文件的操作经验。
Win7系统批处理命令如何删除文件
右键打开右键菜单,新建一个文本文档
把文本文档的.txt后缀改成.cmd或者.bat,比如把“新建文本文档.txt”改成“test.bat”
在弹出的对话框中点击确定
右键点击test.bat,在弹出的菜单中点击编辑
然后输入如下命令(比如要删除该文件夹下所有txt文件);
@echo on
for /r %%f in (*.htm) do del %%f
Ctrl+S保存
把test.bat文件拷贝到你要处理的文件夹下
最后双击test.bat文件之后,
这个文件夹下所有的txt文件都被删除了。
标签:Win7,批处理命令,删除文件
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Excel如何监视窗口
2023-08-28 22:00:04
![](https://img.aspxhome.com/file/2023/0/a155770_0s.gif)
驱动精灵intel芯片组驱动安装失败_驱动精灵intel芯片组驱动安装失败解决方法
2023-03-17 10:13:59
![](https://img.aspxhome.com/file/2023/3/a301450_0s.jpg)
电脑频繁蓝屏重启怎么回事?电脑频繁蓝屏重启解决教程
2023-11-11 00:52:48
![](https://img.aspxhome.com/file/2023/5/48495_0s.jpg)
神舟电脑怎么升级Win11?神舟电脑升级Win11方法教程
2022-07-12 22:16:40
![](https://img.aspxhome.com/file/2023/27/a237619_0s.jpg)
电脑蓝屏显示ACPIBIOSError怎么办?
2023-02-12 15:44:58
![](https://img.aspxhome.com/file/2023/6/a322468_0s.jpg)
Win10笔记本提示未检测到电池怎么办?Win10笔记本未检测到电池的解决方法
2022-04-16 12:58:37
![](https://img.aspxhome.com/file/2023/28/a242013_0s.jpg)
mdi文件是什么格式?使用什么打开mdi文件?
2023-02-22 08:19:46
![](https://img.aspxhome.com/file/2023/6/a322542_0s.jpg)
苹果mac上超赞的AI照片编辑器:Luminar AI
2023-01-15 01:11:13
![](https://img.aspxhome.com/file/2023/8/a207928_0s.png)
Win10重装系统bios识别不到硬盘怎么办?重装系统bios识别不到硬盘的解决方法
2022-02-04 23:25:11
![](https://img.aspxhome.com/file/2023/26/a220256_0s.jpg)
对Windows Server 2008系统自带的磁盘分区进行无损分区的教程图文介绍
2023-04-08 06:12:41
![](https://img.aspxhome.com/file/2023/29/a255951_0s.jpg)
PPT封面页改造实例教程及技巧
2023-02-01 22:53:04
![](https://img.aspxhome.com/file/2023/10/a351703_0s.png)
WPS文字教程:用目录快速定位
2022-12-05 18:02:19
![](https://img.aspxhome.com/file/2023/3/a165153_0s.jpg)
Word如何进行打印预览
2023-05-12 12:48:50
![](https://img.aspxhome.com/file/2023/1/31631_0s.png)
0lympicnews.exe是什么进程
2023-04-01 02:39:20
![](https://img.aspxhome.com/file/2023/6/a320609_0s.jpg)
假日必备!Mac上超经典的游戏让轻松度过假日!
2023-08-02 19:54:19
win10玩辐射2闪退怎么办_win10电脑玩辐射2闪退解决方法
2023-09-19 04:29:36
![](https://img.aspxhome.com/file/2023/2/a286247_0s.jpg)
Win11 Beta 22621.436与22622.436具体有哪些区别?
2022-05-20 20:08:53
![](https://img.aspxhome.com/file/2023/28/a239067_0s.jpg)
Excel中工作表的基本操作
2023-09-07 18:05:49
Win10系统Edge浏览器下载不了文件怎么办?
2023-03-17 18:03:45
![](https://img.aspxhome.com/file/2023/25/a216947_0s.png)
搜狗高速浏览器兼容模式教程
2023-03-23 23:54:22
![](https://img.aspxhome.com/file/2023/30/a265885_0s.jpg)