首页 > 解决方案 > 如何禁用或删除命令后添加的新行 (CRLF)?

问题描述

当我尝试时,"dir"我得到:

02/13/2020  03:29 PM    <DIR>          Saved Games
02/13/2020  03:29 PM    <DIR>          Searches
02/16/2020  12:57 PM    <DIR>          Videos
               1 File(s)              0 bytes
              16 Dir(s)  21,887,438,848 bytes free
  <<<<<<<this new line is what I want to delete or disable

我尝试了类似的命令, findstr "." test.txt > output.txt 但它们都在末尾添加了新行。

谢谢

编辑: 我出口"dir /B" to a file > output.txt

我需要这个,因为另一个程序使用该列表,而最后一个新行使其崩溃。

循环遍历该列表的程序是硬编码的,因此我需要为其提供一个没有空行的列表。

标签: windowsbatch-filecmdnewline

解决方案


推荐阅读