调用命令行时 怎样根据运行结果 决定是否关闭cmd窗口? Topic is solved

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: arcticir, tmplinshi

pk23
Posts: 101
Joined: 24 Apr 2015, 00:49

调用命令行时 怎样根据运行结果 决定是否关闭cmd窗口?

08 Nov 2020, 19:59

现在用的代码是

Code: Select all

runwait, %comspec% /c %commands%
用/c,执行完cmd窗口就关闭;用/k,执行完窗口就不关闭

我想改成:根据运行结果来决定是否关闭cmd窗口。
成功(例如cmd窗口中出现success等预设字符串),则自动关闭
运行中出错(例如预设字符串没出现),则保持窗口不关闭

纯用AutoHotkey有办法实现吗?(不太想用批处理)
Pls quote or @ me when replying, so your reply can be noticed more timely via email notification! cheers~ :D :rainbow:
pk23
Posts: 101
Joined: 24 Apr 2015, 00:49

Re: 调用命令行时 怎样根据运行结果 决定是否关闭cmd窗口?

11 Nov 2020, 15:04

中文区太冷清了……看来还是得用英文发到主板快啊 T_T 呜呜
Pls quote or @ me when replying, so your reply can be noticed more timely via email notification! cheers~ :D :rainbow:
pk23
Posts: 101
Joined: 24 Apr 2015, 00:49

Re: 调用命令行时 怎样根据运行结果 决定是否关闭cmd窗口?  Topic is solved

13 Nov 2020, 15:56

Pls quote or @ me when replying, so your reply can be noticed more timely via email notification! cheers~ :D :rainbow:

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 11 guests