【问题标题】:Start an EXE in Windows from the Command Line that is not a Child Process从不是子进程的命令行在 Windows 中启动 EXE
【发布时间】:2017-10-06 15:57:25
【问题描述】:

我正在尝试使用 PowerShell 或 CMD 从 Windows 命令行开始运行 exe,该 exe 将在关闭终端窗口后继续运行。我已经能够使用以下方法在后台启动该过程:

PowerShell:

Start-Process -NoNewWindow [path-to-exe]

CMD:

start /b [path-to-exe]

在这两种情况下,进程都会启动并继续,直到我关闭控制台,然后进程才会终止。有没有办法绕过父/子关系并保持进程处于活动状态?

【问题讨论】:

标签: windows powershell command-line cmd windows-console


【解决方案1】:

这最终奏效了:

start-process powershell -ArgumentList "[path-to-exe]" -WindowStyle hidden

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-06
    • 1970-01-01
    相关资源
    最近更新 更多