Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.55k stars 572 forks source link

Start /WAIT to a 2nd cmd script returns before script exits if CHOICE.exe is used #2289

Open G4ngst4 opened 3 years ago

G4ngst4 commented 3 years ago

ConEmu build: 210304 x64 (210202 X64 as well) OS version: Windows7 x64 Used shell version :cmd

Problem description

Start /WAIT to a 2nd cmd script returns before script exits if CHOICE.exe is used

Steps to reproduce

  1. make 2 scripts using choice.exe with timeout
  2. make 1 call the other with start /wait
  3. as soon as choice.exe times out on the 2nd script the script will return and the 1st will continue.
  4. doesn't happen with cmd alone
Maximus5 commented 3 years ago

Description is unclear. What do you start and in what order?

G4ngst4 commented 3 years ago

OK thank you, heres some simple code to demo the issues: ConEmu Features: Process 'Start' is TICKED. Choice.exe binaries are from windows 7 64 bit. both the 32 bit & 64 bit Choice.exe binaries test the same. All Script2.cmd will fire in MAIN script as soon as Choice.exe timeout in Script2 Expires, before the scripts exit.

MAIN SCRIPT:

@echo off

        CHOICE.exe /C 1S  /N /T 5 /D 1 /M "*****  TYPE:  [1] to Start Script2 [S] to Skip  ***** ?  (Auto Start in 5S...)"
        Start /wait Script2.cmd
        Start /wait Script2.cmd
        Start /wait Script2.cmd

Script2.cmd:

@echo off

        ECHO  THIS IS SCRIPT 2
        CHOICE.exe /C 1S  /N /T 5 /D 1 /M "*****  TYPE:  [1] to Start Script2 [S] to Skip  ***** ?  (Auto Start in 5S...)"

        pause