Skip to content

Eliminate Terminate batch job (Y/N)? prompt within .bat #9343

@YO4

Description

@YO4

On Windows, bat file is generated, thus cause Ctrl-C produce the following behavior:

Terminate batch job (Y/N)?

Which is very inconvenient.
[The above is shamelessly copied from #8199. Thanks!]

From this discussion, the prompt message can be suppressed by specific batch file.

@echo off & setlocal EnableDelayedExpansion
ruby %*& call set $?=!ERRORLEVEL!
echo exit with %$?%
exit /b %$?%

The successful completion of the call set following a ruby invocation appears to prevent cmd.exe recognizing the ruby interrupted state.

Could anything get worse now if a command follows the ruby call?
I hope the prompt will no longer appear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions