Windows系统中环境变量不展开的问题

Windows系统中环境变量不展开的问题

问题现象:Windows、System32等系统目录里命令,无法通过Path搜索路径来执行。查看Path环境变量结果如下:

D:\>echo %Path%
%SystemRoot%;%SystemRoot%\System32;......

问题原因:cmd.exe里,path里包含的环境变量没有展开。

解决办法:

变量的类型可能存在问题。

REG_SZ 为 字符串类型

REG_EXPAND_SZ 为 可扩展字串类型

Two things I might try.

  1. Run an sfc /scannow to see if that fixes any larger issues at play.
  2. Check the registry for the Path key in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. What's thetype. It should say REG_EXPAND_SZ

============ End

猜你喜欢

转载自www.cnblogs.com/lsgxeva/p/11592157.html