@echo off
@set Path_=D:\Program Files
for,/f,"skip=4 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
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
相关文章: