Bonjour les développeurs.

Voici un menu ordinaire pour lancer / afficher des scripts

Code Batch : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@echo off
Title Menu au choix
color 07
:menu
Title Menu au choix
cls
color 07
echo.
echo Que voulez-vous faire ?
echo.
echo 1. Afficher le script 1
echo.
echo 2. Afficher le script 2
echo.
echo 3. Quitter
echo.
set Response=
set /p Response=Tapez votre choix et appuyez sur ENTREE: 
 
if "%Response%"=="1" goto :script1
if "%Response%"=="2" goto :script2
if "%Response%"=="3" goto :fin
if not defined "%Response%" goto menu
:script1
title Script 1
cls
color 4f
echo.
echo Tapez ou collez le script 1
echo.
pause
goto menu
:script2
title Script 2
cls
color b
echo.
echo Tapez ou collez le script 2
echo.
pause
goto menu
:fin
exit


Je voudrais utiliser le menu ci-dessous pour faire la même chose

Code Batch : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@if (@CodeSection == @Batch) @then
@echo off
setlocal EnableDelayedExpansion
 
rem Multi-line menu with options selection via DOSKEY
rem Antonio Perez Ayala
 
rem Define the options
set numOpts=0
for %%a in (First Second Third Fourth Fifth) do (
   set /A numOpts+=1
   set "option[!numOpts!]=%%a Option"
)
set /A numOpts+=1
set "option[!numOpts!]=Exit"
 
rem Clear previous doskey history
doskey /REINSTALL
rem Fill doskey history with menu options
cscript //nologo /E:JScript "%~F0" EnterOpts
for /L %%i in (1,1,%numOpts%) do set /P "var="
 
:nextOpt
cls
echo MULTI-LINE MENU WITH OPTIONS SELECTION
echo/
rem Send a F7 key to open the selection menu
cscript //nologo /E:JScript "%~F0"
set /P "var=Select the desired option: "
echo/
if "%var%" equ "Exit" goto :EOF
echo Option selected: "%var%"
echo.
pause
goto nextOpt
 
 
@end
 
var wshShell = WScript.CreateObject("WScript.Shell"),
    envVar = wshShell.Environment("Process"),
    numOpts = parseInt(envVar("numOpts"));
 
if ( WScript.Arguments.Length ) {
   // Enter menu options
   for ( var i=1; i <= numOpts; i++ ) {
      wshShell.SendKeys(envVar("option["+i+"]")+"{ENTER}");
   }
} else {
   // Enter a F7 to open the menu
   wshShell.SendKeys("{F7}{HOME}");
}

Cela est-il possible ?

Merci de bien vouloir m'aider.