i try to remove this prompt
i want to change it to paused for example
how to do that?
How to do change "Terminate batch job (Y/N)?"
Moderator: DosItHelp
Re: How to do change "Terminate batch job (Y/N)?"
i could do this ?
Re: How to do change "Terminate batch job (Y/N)?"
It 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.
Szecska
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
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: How to do change "Terminate batch job (Y/N)?"
It's built into cmd.exe; you'd have to hex edit the executable to have it return a different string.
Re: How to do change "Terminate batch job (Y/N)?"
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
Re: How to do change "Terminate batch job (Y/N)?"
Here's an example:
You have to run this script synchronously with the original script, but I can't help you with that sadly
Ask some expert about it, personally I know that David (Dbenham) had dealt with this problem in his Snake game.
Szecska
Edit:I almost forgot: You have to insert a Ctrl+c character where i labelled, I recommend using some sort of hex editor to do that. Also the script wasn't tested yet.
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
Ask some expert about it, personally I know that David (Dbenham) had dealt with this problem in his Snake game.
Szecska
Edit:I almost forgot: You have to insert a Ctrl+c character where i labelled, I recommend using some sort of hex editor to do that. Also the script wasn't tested yet.
-
- Posts: 240
- Joined: 04 Mar 2014 11:14
- Location: germany
Re: How to do change "Terminate batch job (Y/N)?"
Hallo Userdosfx,
I do not know what you exactly want.
I hope you know exactly what you want.
Describe at least what you plan and what should be different.
Do you want to abort the script and suppress the message?
Do you want to pause - then use the pause command or the pause key.
https://administrator.de/forum/1-progra ... ent-764408
Phil
I do not know what you exactly want.
I hope you know exactly what you want.
Describe at least what you plan and what should be different.
Do you want to abort the script and suppress the message?
Do you want to pause - then use the pause command or the pause key.
https://administrator.de/forum/1-progra ... ent-764408
Phil