Board logo

标题: [文本处理] 求助:echo.set 系统变量=%系统变量%>b.txt问题 [打印本页]

作者: lqs633    时间: 2018-3-25 23:18     标题: 求助:echo.set 系统变量=%系统变量%>b.txt问题

本帖最后由 lqs633 于 2018-3-25 23:24 编辑

批处理“a.bat”为下面两行:
set 系统变量=%userprofile%
echo.set 系统变量=%系统变量%>b.txt

我需要执行批处理"a.bat"得到:文本"b.txt"的内容为下面一行:
set 系统变量=%%userprofile%%
而不是:set 系统变量=C:\Documents and Settings\***
作者: yhcfsr    时间: 2018-3-26 09:20

  1. set 系统变量=%%%%userprofile%%%%
  2. set 系统变量>b.txt
复制代码

作者: Batcher    时间: 2018-3-26 09:22

  1. set 系统变量=%%userprofile%%
  2. echo set 系统变量=%系统变量%>b.txt
复制代码
  1. set 系统变量=%%%%userprofile%%%%
  2. echo set 系统变量=%系统变量%>b.txt
复制代码

作者: lqs633    时间: 2018-3-26 15:44

回复 2# yhcfsr


    谢谢
作者: lqs633    时间: 2018-3-26 15:45

回复 3# Batcher


    谢谢




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2