Windows 7 Windows7忽略部分路径(在我的例子中是powershell)
windows 7未激活powershell的路径 1) C:\Windows\System32\WindowsPowerShell\v1.0存在于我的路径中Windows 7 Windows7忽略部分路径(在我的例子中是powershell),windows-7,path,Windows 7,Path,windows 7未激活powershell的路径 1) C:\Windows\System32\WindowsPowerShell\v1.0存在于我的路径中 C:\GitRepository>path PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0; 2) 无法从cmd隐式运行powershell C:\G
C:\GitRepository>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0;
2) 无法从cmd隐式运行powershell
C:\GitRepository>powershell
'powershell' is not recognized as an internal or external command, operable program or batch file.
3) 但它是显式运行的
C:\GitRepository>c:\Windows\System32\WindowsPowerShell\v1.0\powershell
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\user\Androidwork\WebDevelopment\GitRepository> exit
C:\Users\user\Androidwork\WebDevelopment\GitRepository>
有什么想法吗?您的问题是通往PowerShell的路径前面的空间。只需移除它们,即:
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;
我发现我安装的一个程序删除了;在将Powershell路径与下一个路径分离的路径中;C:\Windows\System32\WindowsPowerShell**v1.0\C:*\program files\other program。分号设置到位后,powershell.exe成功启动。Filburt:这是一个路径问题,并非特定于powershell。Joey,1)你是对的。2) 根据您的答案更改标题。3) 非常感谢您的帮助哦,主要是针对添加标签的编辑;)乔伊,小纸条。据我所知,前导空格会导致windows只忽略特定的路径项,但windows仍然正确处理路径的其余部分。是的,它不会破坏所有内容,但您仍然不应该这样做;)没有完全解决我的问题,但使我认识到我需要.cmd文件中Powershell.exe(c:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe)的完整路径,因为它不在路径上。