huyinjie

无法在 PowerShell 里启动 CMD

  •  
  •   huyinjie · Jul 3, 2017 · 4489 views
    This topic created in 3298 days ago, the information mentioned may be changed or developed.

    提示如下

    cmd : 无法将“ cmd ”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确
    
    10 replies    2017-07-04 12:12:21 +08:00
    iVeego
        1
    iVeego  
       Jul 3, 2017 via Android
    .\cmd 试试?
    huyinjie
        2
    huyinjie  
    OP
       Jul 3, 2017
    @iVeego 还是相同的报错
    tghgffdgd
        3
    tghgffdgd  
       Jul 3, 2017
    你确定环境变量没问题吗,先试下完整路径行不行
    huyinjie
        4
    huyinjie  
    OP
       Jul 3, 2017
    @tghgffdgd 找另一台同版本 Win10 对比了下没问题,PowerShell 完整路径是什么呢
    tghgffdgd
        5
    tghgffdgd  
       Jul 3, 2017
    @huyinjie 你是要在 ps 里启动 cmd,这里是说 cmd 的路径,c:\windows\system32\cmd.exe 如果可以那应该是环境变量问题,不行那就确认下文件还在不
    imn1
        6
    imn1  
       Jul 3, 2017
    cmd.exe
    geelaw
        7
    geelaw  
       Jul 3, 2017 via iPhone
    你的系统可能有点 beyond repair 了……?
    imn1
        8
    imn1  
       Jul 3, 2017
    啊,我知道了,你不是在 powershell console,是在 PS ISE 里面运行吧?
    lslqtz
        9
    lslqtz  
       Jul 4, 2017
    @imn1 我在 ISE 是这样的:
    PS C:\Users\lslqtz> cmd
    无法启动“ cmd ”。不支持交互式控制台应用程序。
    若要运行该应用程序,请使用 Start-Process cmdlet,或者使用“文件”菜单中的“启动 PowerShell.exe ”。
    若要查看 /修改被阻止的控制台应用程序,请使用 $psUnsupportedConsoleApplications,或者查阅联机帮助。
    At line:0 char:0
    huyinjie
        10
    huyinjie  
    OP
       Jul 4, 2017   ❤️ 2
    @lslqtz @geelaw @tghgffdgd @iVeego @imn1
    在系统变量里添加这两个路径后修复了问题
    ```
    C:\WINDOWS\System32\
    C:\WINDOWS\System32\WindowsPowerShell\v1.0\
    ```
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5471 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 06:47 · PVG 14:47 · LAX 23:47 · JFK 02:47
    ♥ Do have faith in what you're doing.