Help with menu

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
pedrodalterio
Posts: 2
Joined: 21 Feb 2022 10:52

Help with menu

#1 Post by pedrodalterio » 21 Feb 2022 11:04

Hello everyone, im new here, so i don't know if i posted on the right place, sorry if i didn't.

The thing is, i have my menu in a bat and i works fine but i want to make the choice open in a new window insted on same window

Code: Select all

c:\scripts\cmdMenuSel.exe F870                                                                                                                                                                                                                                                                  "                                  |   Ferramentas Windows   |"                                                                                                                                                                                                                                       "                                  |   Rede e Mapeamentos    |" 																		      "                                  |   Suporte               |"                                                                                                                                                                                                                                                 "                                  |   Utilitarios           |"                                                                                                                                                                                                                                                 "                                  |   Sair                  |"
if %ERRORLEVEL% == 1 goto ferramentaswin
if %ERRORLEVEL% == 2 goto redemap
if %ERRORLEVEL% == 3 goto sup
if %ERRORLEVEL% == 4 goto utilitarios
if %ERRORLEVEL% == 5 exit

REM inicio do FERRAMENTASWIN
:ferramentaswin
@echo off
mode 58, 18
c:\scripts\batbox.exe /g 0 1
echo %HORARIO%
exemple, above i have a menu select and when i select "Ferramentas Windows" it goes to :ferramentaswin... and it works, i just want it to pop in a new windows and preserve my initial menu, is it possible?

T3RRY
Posts: 250
Joined: 06 May 2020 10:14

Re: Help with menu

#2 Post by T3RRY » 22 Feb 2022 09:42

You mean something like this?
viewtopic.php?t=6581

pedrodalterio
Posts: 2
Joined: 21 Feb 2022 10:52

Re: Help with menu

#3 Post by pedrodalterio » 24 Feb 2022 15:33

something like it... i think i solved my problem
Image
i've added this if on the begining of the bat

Code: Select all

@echo off
if [%1] EQU [] (
goto menu 
) else (
goto %1 
)
)
and edited the ifs on errorlevels to call the label inside the own file

Code: Select all

if %ERRORLEVEL% == 1 (
cls
start cmd.exe /k call "c:\scripts\carregar.bat" ferramentaswin 
goto menu
)
kinda worked the way i wanted, don't know if there's another way to do it, probably yes :D

Post Reply