【问题标题】:Windows Command Prompt hangs after running batch file运行批处理文件后 Windows 命令提示符挂起
【发布时间】:2020-09-02 14:07:30
【问题描述】:

我正在尝试设置一个快速批处理文件,它在运行时设置我的开发环境(在 Windows 10 上)。到目前为止,我所做的只是:

@echo off

w:
pushd directory_of_project

call build.bat //build project
call vsdbg.bat //run a batch file which opens up visual studio's debugger
call 4ed //Open my code editor exe

popd

一切正常,除了设置完所有内容后,我的命令窗口挂起,我无法按 Ctrl+C 退出。命令提示符仅在关闭 4ed 程序后完成。有没有办法修改我的批处理文件以防止这种情况发生,这样我就不必打开另一个命令提示符窗口?

【问题讨论】:

  • 命令处理器等待每个命令或程序完成。 4ed 实际上叫4ed.exe,对吧?所以你不需要call。要不等待其终止,请使用start,如下所示:start "" 4ed.exe,或start "" /B 4ed.exe for 4ed 使用相同的控制台窗口...

标签: windows cmd command-line command-prompt


【解决方案1】:

我想通了:

@echo off

w:
pushd directory_of_project

call build.bat //build project
call vsdbg.bat //run a batch file which opens up visual studio's debugger
start 4ed //Open my code editor exe

popd

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-27
    • 2010-11-29
    • 2016-02-08
    • 1970-01-01
    • 1970-01-01
    • 2015-10-05
    相关资源
    最近更新 更多