防止.bat文件在创建另一个.bat文件时最后保留空白行 [英] Prevent .bat file from leaving blank line in the end while creating another .bat file

查看:110
本文介绍了防止.bat文件在创建另一个.bat文件时最后保留空白行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个.bat文件,该文件将创建代码并将其写入另一个.bat文件.

I am creating a .bat file, that creates and writes code to another .bat file.

问题是,它总是在最后留下一个空白行.我的代码是:

The problem is, it always leaves a blank line in the end. My code is:

ECHO ^@echo off> fb.bat
ECHO echo This is a>> fb.bat
ECHO test>> fb.bat
ECHO file>> fb.bat

输出类似于:

 @echo off
 echo This is a
 test
 file
 

如何防止它最后创建空白行?

How can I prevent it from creating a blank line in the end?

推荐答案

我只需要使用:

echo | set /p dummyName="last line code/text">> fb.bat

在最后一行.就我而言:

At the last line. In my case:

echo | set /p dummyName="file">> fb.bat

可以解决问题.

这篇关于防止.bat文件在创建另一个.bat文件时最后保留空白行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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