Windows7忽略了部分路径(在我的案例中是powershell)

时间:2012-06-29 07:29:01

标签: 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:\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> 

有什么想法吗?

2 个答案:

答案 0 :(得分:4)

您的问题是PowerShell路径前面的空格。只需删除它们,即:

PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0; 

答案 1 :(得分:0)

我发现我安装的其中一个程序删除了;在将Powershell路径与下一个路径分开的路径中。 ; C:\ Windows \ System32 \ WindowsPowerShell ** v1.0 \ c:** \ program files \ other program。一旦分号到位,powershell.exe就会成功启动。

相关问题