我的问题是“如何在批处理文件中写入批处理文件,这将在运行时创建新批处理文件?”
就像这样:
回波系统信息>>info.txt >>SystemInfo.bat
我不想使用新的批处理文件(SystemInfo.bat),当运行create Info.txt时,其中包含系统信息。
有什么解决办法吗?
发布于 2013-06-19 05:36:44
你必须避开特殊的字符:
echo systeminfo ^>^>info.txt >>SystemInfo.bat发布于 2022-04-11 14:52:56
try this:
@echo off
echo Welcome
echo > echo @echo off >> batchfilename.bat
echo > echo echo hello >> batchfilename.bat
echo > echo pause >> batchfilename.bat
it will write the code to another batch file like batchfilename.bat
(it will turn off echo, output hello and then pause so you can read it.) https://stackoverflow.com/questions/17183510
复制相似问题