如何在运行batch file时禁用Ctrl-C / Ctrl-S

默认情况下,当用户按下Ctrl-C时可以终止batch file,按Ctrl-S可以暂停batch file。 有没有办法来禁用这个? MS-DOS BREAK命令明显用于执行此操作,但现在在Windows中将其忽略。 我需要在WinNT 4.0和Win2K中有效的东西。

无视帮助确认:

C:> break /? 设置或清除DOS系统上的扩展CTRL + C检查

这与DOS系统兼容。 它在Windows下没有任何作用。

部分解决方法:启动/ MIN / B myscript.cmd:

B Start application without creating a new window. The application has ^C handling ignored. Unless the application enables ^C processing, ^Break is the only way to interrupt the application.