大家好,我修改了网上的一个批处理文件,先判断系统变量中有没有python,如果没有就添加,但是echo %PathAll_%| find /i "%Path_%"这一句总是出问题,但是如果我把Path_=C:\Program Files (x86)\Python37-32\Scripts\;C:\Program Files (x86)\Python37-32\; 改成Path_=C:\Program Files (x86)\Python37-32\Scripts\就没有问题,请问,问题出在什么地方?- @echo off
- @set Path_=C:\Program Files (x86)\Python37-32\Scripts\;C:\Program Files (x86)\Python37-32\;
- for,/f,"tokens=1,2,*",%%a,in,('reg query "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v Path'),do,(@set PathAll_=%%c)
-
- echo %PathAll_%| find /i "%Path_%" && set IsNull=true|| set IsNull=false
- echo %IsNull%
-
- if not %IsNull%==true (
- reg add "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /d "%PathAll_%;%Path_%" /f )
- pause
复制代码
|