如何删除“无扩展名的文件"的所有内容?使用Windows批处理命令 [英] How to Delete all contents of a "File with no extension" using windows batch Command

查看:431
本文介绍了如何删除“无扩展名的文件"的所有内容?使用Windows批处理命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除扩展名为"FIle"的文件的内容,即没有扩展名. 我知道如何删除文本文件的内容,但不知道如何删除以文件"为扩展名的文件.

I want to delete the contents of a file which has "FIlE" as extension i.e with no extension. I know how to delete the contents of a Text file, but not about the file which has "File" as extension.

感谢您的努力. 预先感谢.

I would appreciate your efforts. Thanks in advance.

推荐答案

在批处理文件中使用Del *.删除没有扩展名的文件.

Use Del *. in batch file to remove files with no extension.

使用Dir /A-D *.列出所有不带扩展名的文件.

use Dir /A-D *. to list down all files with no extension.

使用以下命令清除文件内容

Use following command to clear the contents of a file

findstr "Any data that is not available in origfilename" origfilename > origfilename

这篇关于如何删除“无扩展名的文件"的所有内容?使用Windows批处理命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆