How to do change "Terminate batch job (Y/N)?"
Posted: 15 Oct 2019 10:19
i try to remove this prompt
i want to change it to paused for example
how to do that?
i want to change it to paused for example
how to do that?
A Forum all about DOS Batch
https://www.dostips.com/forum/
---copied from computerhope.comSets or clears extended Ctrl+C checking on DOS system.
Break syntax is present for compatibility with DOS systems. It has no effect under Windows.
If command extensions are enabled, and running on the Windows platform, then the BREAK command will enter a hard coded breakpoint if being debugged by a debugger.
I want code exampleSzecska wrote: ↑16 Oct 2019 14:47It can be done but you have to handle all the keyboard input. There's the 'xcopy /w' and 'replace /w' methods for that(getting all the keys), I will link them later.
But if you just want a simple code, then it does not worth the effort.
Ps: In older versions, there's the break command wich turns off Ctrl+C totally. In windows, this feature isn't working.---copied from computerhope.comSets or clears extended Ctrl+C checking on DOS system.
Break syntax is present for compatibility with DOS systems. It has no effect under Windows.
If command extensions are enabled, and running on the Windows platform, then the BREAK command will enter a hard coded breakpoint if being debugged by a debugger.
Szecska
Code: Select all
@echo off
setlocal enabledelayedexpansion && rem basic setup
for %%I in ("%cd%") do set odrive=%%~dI & if not %%~dI==%systemdrive% %systemdrive% & rem This line corrects the strange behavior of replace /w and xcopy /w on fat32 drives by changing the path to the system drive
:begin
for /f skip^=1^ delims^=^ eol^= %%A in ('replace ? . /u /w') do set key=^%%A & rem This gets a single character from the keyboard
if "!key!"=="<Ctrl+c here>" goto AboutToEnd & rem If the input equals with (0x03;the ctrl+c character), goes to the AboutToEnd flag
goto begin
:AboutToEnd
choice /m "This is your message!(Y/N)" /c yn /n & rem type 'choice /?' to the command line for explanation
if %errorlevel%==1 exit /b
goto begin