发生错误时如何防止批处理窗口关闭? [英] How to prevent batch window from closing when error occurs?
问题描述
我正在尝试编写批处理脚本以创建一个尚不存在的文件夹. 跟进在线示例,下面是我的脚本.
I'm trying to write batch script to create a folder if it does not already exist. Following up the online examples, below is my script.
问题是;第一个pause
有效,然后可能由于语法错误窗口关闭,甚至在到达第二个pause
之前,所以我无法真正分辨出脚本的哪一部分是错误的.
The problem is; first pause
works, then probably due to syntax error the window closes even before reaches to the second pause
, so I can't really tell which part of my script is wrong.
谁能告诉我如何防止关闭窗口,以便我可以看到窗口上有什么东西?
Could anyone show me how to prevent closing window so that I can see what's on the window?
@echo off
:copy theme images over
:designer
echo copying theme images over...
pause
if not exist "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text"
(
md "%K2DIR%\K2 SmartForms Runtime\Styles\Themes\Sharepoint 2013\rich_text333"
)
pause
推荐答案
您需要将/K开关传递给CMD,或者只是打开命令窗口并从命令行运行批处理.
You need to pass the /K switch to CMD, or just open a Command Window and run the batch from the command line.
这篇关于发生错误时如何防止批处理窗口关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!