我想根据操作系统名称在文本文件中添加几行。伪代码示例:
os==windows 7 then open file c:\1.txt else open file c:\2.txt
我想向该文本文件添加一些静态文本并保存该文本文件。 如何在批处理脚本中执行此操作?我的伪代码尝试:
FOR /F "delims=" %i IN ('ver') DO set osver=%i
echo %osver%
if %osver% == "Microsoft Windows [Version 6.1.7601]"
set filepath == C:\1.txt and open 1.txt file and add text" abc "
else
set filepath == C:\2.txt and open 2.txt file and add text " abc"