发生错误时如何防止批处理窗口关闭?

问题描述:

我正在尝试编写批处理脚本以创建一个尚不存在的文件夹. 跟进在线示例,下面是我的脚本.

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.