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

时间:2019-09-26 16:13:38   收藏:0   阅读:338

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

 

原文:https://www.cnblogs.com/lsgxeva/p/11592157.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!