问题现象:Windows、System32等系统目录里命令,无法通过Path搜索路径来执行。查看Path环境变量结果如下:
D:\>echo %Path% %SystemRoot%;%SystemRoot%\System32;......
问题原因:cmd.exe里,path里包含的环境变量没有展开。
解决办法:
变量的类型可能存在问题。
REG_SZ 为 字符串类型
REG_EXPAND_SZ 为 可扩展字串类型
Two things I might try.
- Run an
sfc /scannowto see if that fixes any larger issues at play. - Check the registry for the
Pathkey inHKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment. What's thetype. It should sayREG_EXPAND_SZ
本文描述了在Windows系统中,由于Path环境变量中的注册表键类型问题导致无法通过Path搜索路径执行命令的现象。提出通过运行`sfc/scannow`检查并核实Path键类型为REG_EXPAND_SZ的解决方法。
1144

被折叠的 条评论
为什么被折叠?



