Windows 10: CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside

Discus and support CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside in Windows 10 Customization to solve the problem; Hi, I use some batch files for exemple to launch Jetty. Example @echo off set CUR=%~dp0 ... :check_JETTY_BASE if exist "%JETTY_BASE%" goto... Discussion in 'Windows 10 Customization' started by ArfyFR, Feb 26, 2020.

  1. ArfyFR Win User

    CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside


    Hi,


    I use some batch files for exemple to launch Jetty. Example

    @echo off

    set CUR=%~dp0


    ...

    :check_JETTY_BASE
    if exist "%JETTY_BASE%" goto ok_JETTY_BASE
    echo Error: JETTY_BASE set to "%JETTY_BASE%" but directory does not exist
    goto error



    :ok_JETTY_BASE



    cd %JETTY_BASE%
    java -jar %JETTY_HOME%/start.jar %JETTY_OPTIONS% %JETTY_STOP_OPTIONS% --module=ext jetty-started.xml
    pause
    goto end



    :error
    cd
    /D "%CUR%"
    exit /b 1



    :end
    cd
    /D "%CUR%"



    All is launched well.

    ⇒ Jetty is well launched and serve requests.

    ⇒ Batch launch stays as expected before the pause cmd.

    ⇒ if I use the "Jetty STOP" command, no problem, "pause is called"


    My question is about the CTRL-C, why does it not "stop" the java call, but the CMD.EXE batch?

    I see then

    'Terminate batch job Y/N?'

    • if I do CTRL-C twice, the Jetty java stays in memory *sigh*
    • if I reply "Yes" same problem *sigh*
    • if I reply "No" ⇒ ok "pause is called"


    Does it exist a way inside .BAT to forward the CTRL-C to here the


    java -jar %JETTY_HOME%/start.jar %JETTY_OPTIONS% %JETTY_STOP_OPTIONS% --module=ext jetty-started.xml


    ?

    :)
     
    ArfyFR, Feb 26, 2020
    #1

  2. .Jar Files only executable trough CMD terminal java -jar [FileName]

    i have sent an massage earlier but i dit not get an reply after the first answer:


    SV

    asked on

    I have a problem i upgraded to windows 10 and i suddenly was unable to open .jar (java) files.

    I used to be able to just double click the .jar file or , open with java(TM) platform SE binary ,.

    I found a solution to that problem , by win+r (run) running :CMD and navigating to the file map, and typing this command: java -jar [FileName] than it finally worked/opened. this method is very time consuming
    and i have to run all those codes CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside :( .

    now is the question: how can i get java to work fully?

    what i want is that i can simply click the .jar file and just open it. because the method in the console is hard an time consuming

    this worked on windows 7/8 how can i fix this?

    is i now click the file set to open with java a window pops up for a split second it seems empty(a CMD like window).

    * I have the latest version of java.

    * I have tried removing and reinstalling java.

    * I am an gamer and i have a relay good/fast PC so that can not be the issue.

    You had this question


    • CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside [​IMG]




    WV

    Wungraileng Vashi replied on


    Hi Sijmen,

    Thank you for posting your query in Microsoft Community.

    I understand the inconvenience caused. I will be glad to assist you with this.

    I would suggest you to try the steps below and check if it helps:

    1. Type "default programs" in the search and open it.

    2. Click on "associate a file type or protocol with a program".

    3. Locate .jar and click on it.

    4. Click on "change program" and choose the appropriate existing program that you used to open .jar files.

    Do get back to us with the result. We will be glad to help if you need further assistance.

    Be the first person to mark this helpful


    • CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside [​IMG]



    SV

    replied on

    I followed your instructions

    and java:"Java(TM) Platform SE binary"was already selected

    and i like to know how to fix this cause is is quite annoying.
     
    Sijmen van Bommel, Feb 26, 2020
    #2
  3. Rubi Win User
    Allowing Local Standard Account Log On As Batch Job Rights

    Hi das10 and thanks for the response.

    This was my concern that there might be security implications.

    So, this was what I did step by step to get to this point:

    1. created a task using the information from this link:
    How to change the Windows Defender update frequency

    2. the task ran successfully but the command prompt window was open as mentioned

    At this point the only change I made was to switch in the task from "Run only when user is logged on" to "Run whether user is logged on or not". It was at this time that I was asked for a password, received an error message about rights and batch jobs.

    3. I then logged in to the admin account and changed the setting in GPE based on the information here:
    Log on as Batch Job Rights for Task Scheduler — danblee.com

    I did not set "Run with highest privileges" either in the initial task or after changing the GPE setting.

    The task runs as I wanted it to but as you pointed out there may be security implications.

    This is a personal/work computer and nobody else has access to it (if that makes a difference).

    Are you suggesting I undo the changes to GPE?

    Thanks!
     
  4. JYC_robs Win User

    CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside

    Windows Installation Error (Unable to update boot configuration)

    Hello,

    I have the exact same issue that detailed in this question. I have completed your suggested CMD commands:


    • bootrec /fixmbr

    • bootrec /fixboot

    • bootrec /scanos

    • bootrec /rebuildbcd

    But I think you left off the last part. After "bootrec /rebuildbcd, Windows asks : "Add installation to boot list? Yes(Y)/No(N)/All(A)"

    Which do I choose??? Y, N, or A??

    Eagerly awaiting your reply. Thanks!


     
    JYC_robs, Feb 26, 2020
    #4
Thema:

CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside

Loading...
  1. CMD.EXE - 'Terminate batch job Y/N?', replying yes detach java call inside - Similar Threads - CMD EXE 'Terminate

  2. Cmd Dosent Open and terminal

    in Windows 10 Gaming
    Cmd Dosent Open and terminal: My Cmd and Terminal Dosent want to open https://answers.microsoft.com/en-us/windows/forum/all/cmd-dosent-open-and-terminal/f120534b-d591-4294-9e3e-97e796a10da1
  3. Cmd Dosent Open and terminal

    in Windows 10 Software and Apps
    Cmd Dosent Open and terminal: My Cmd and Terminal Dosent want to open https://answers.microsoft.com/en-us/windows/forum/all/cmd-dosent-open-and-terminal/f120534b-d591-4294-9e3e-97e796a10da1
  4. Access denied for every batch job

    in Windows 10 BSOD Crashes and Debugging
    Access denied for every batch job: Even if the batch job only contains an echo hello and a pause. Of course if I run it as administrator it works, but for some of my apps this option is not available. None of my IDEs work, Arduino, Eclipse, or VScode. In particular, with VScode, the batch file in question is...
  5. Calls are blocked. Yes.

    in Windows 10 Ask Insider
    Calls are blocked. Yes.: https://gyazo.com/aabdb5b60638389c1f6ca3ddc15461e7 ^^^^^^^^^^^^^^^^^ Not sure how to troubleshoot this... I've checked the "Learn More" and tried all of them. Is there a way to fix this? Win10, brand new computer Android v.10, Samsung A70 McAfee anti-virus (not the...
  6. Graphics in Cmd or Batch?

    in Windows 10 BSOD Crashes and Debugging
    Graphics in Cmd or Batch?: Hello, i want to insert graphics into a batch script, i know it works, but i don't know a command to do so. TIA LG creativeandmore Grafik in Cmd oder Batch?
  7. CMD Batch file help

    in Windows 10 Support
    CMD Batch file help: Hello, i am running into a issue i am trying to resolve but im getting nowhere and hopefully someone could help me. I'm simply trying to point a copy to parent or "grand"parent directory/folder. I tried ".." but it seems to come back the same message Code: The system cannot...
  8. CMD, PowerShell, Windows Terminal

    in Windows 10 Ask Insider
    CMD, PowerShell, Windows Terminal: I have recently returned to windows after 10 years of OSX/MacOS and Linux. During my time on these OSes I became very comfortable with using the terminal on a daily basis for minor tasks to system configuration and diagnostics. I loved the power these tools have and wish to...
  9. SFTP command for automatic batch job

    in Windows 10 Customization
    SFTP command for automatic batch job: psftp *** Email address is removed for privacy *** -l username -pw password If I am using sftp in windows 10, what is the command to put the password behind like psftp ?...
  10. Parallel batch jobs in one scheduled task

    in Windows 10 Support
    Parallel batch jobs in one scheduled task: Parallel batch jobs in one scheduled task hi, This should be an easy answer. I want to create one scheduled task, it will be called "CLEAR_PHOTOSBYDATE", see attached pic or (approximate example, not literal job...yet)...

Users found this page by searching for:

  1. batch file ask Terminate batch job (Y/N)? after some time