2

I made and tested simple batch script to launch one of two applications in windows 10 using the CHOICE attribute with a 30 second timeout and one START function set as the default.

I moved my batch file over to my target thin client running windows 7 embedded standard and upon executing i realized that WES7 does not support the choice command. I need this to be as simple as possible with just one button use (no enter key) but I'm struggling to figure out my alternatives here. Here is the batch i was using.

@ECHO OFF
CLS
ECHO =============
ECHO 1.first app
ECHO 2.second app
ECHO.

CHOICE /C 12 /T 30 /D 1 /M "Enter your choice by pressing 1 or 2:"

:: Note - list ERRORLEVELS in decreasing order
IF ERRORLEVEL 2 GOTO app2
IF ERRORLEVEL 1 GOTO app1
:app1
ECHO running app1
START app1.exe
goto begin

:app2
ECHO running app2 
START app2.exe
goto begin
:End
  • @ChristianParazuli, I do not have a copy of any embedded version, but I cannot think that choice would be excluded. Can you confirm why you say that it is not working? – Gerhard May 01 '21 at 13:25
  • choice.exe is not available in WES7 for whatever reason. I opened up my install and it is not available. It seems its not available on the 64 bit variant either. I wonder if i can just drop in a 32 bit copy of choice.exe from a full version of windows 7.. – Christian Parazuli May 01 '21 at 13:39
  • so if you open `cmd` and type `choice /?` what message is displayed? – Gerhard May 01 '21 at 14:06
  • @Gerhard it gives the usual "not recognized as an internal command" error. I found a copy of choice.exe from a vanilla win7 32 bit build and it works. A whole 30kb in size. This seems to be one of Microsoft's more strange size cutting measures in WE7 Now my issue is that My startup batch script is losing focus once its launched from startup. Have to figure out that one next. – Christian Parazuli May 01 '21 at 15:45

0 Answers0