标题: [文本处理] 批处理怎么重置所有变量? [打印本页]
作者: 502283644 时间: 2014-9-27 21:58 标题: 批处理怎么重置所有变量?
set /p a=
................................................................
作者: 普大喜奔 时间: 2014-9-27 22:31
回复 1# 502283644
我连题都看不懂。。。
作者: 523066680 时间: 2014-9-27 22:41
回复 2# 普大喜奔
可能是没事做随便打出点什么就发表了……
作者: CrLf 时间: 2014-9-28 00:16
1、除非你知道在做什么,否则不建议用这种办法:- for /f "eol== delims==" %%a in ('set') do set "%%a="
复制代码
2、较推荐:- set a=test
-
- setlocal
- ::可以理解成一个“还原点”
-
- set a=100
-
- endlocal
- ::还原到上一个 setlocal 之前的变量状态
-
- echo %a%
复制代码
作者: Linuxer 时间: 2014-9-28 00:29
先保存一份bak再说清的事,,复制代码
作者: 502283644 时间: 2014-9-30 22:32
回复 3# 523066680
有一些变量不想要了就想中途删除变量
作者: 502283644 时间: 2014-9-30 22:35
echo set /a asd=1234567
后面的asd变量都是1234567
想中途停止使用
作者: Linuxer 时间: 2014-9-30 23:05
回复 7# 502283644 - @echo off
- set a=123
- echo %a%
- set a=
- echo,%a%
- pause
复制代码
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |