I want to create a batch file in which I have selected an choice and after selection it executes the task. What I'm expecting is to create another choice within a choice where it will ask me to enter a number and based on the number the task will be executed.
@ECHO off
cls
:start
title [ Lazy Planner]
ECHO ===========================================================================================
ECHO.
type "C:\Automation\doh.txt"
ECHO.
ECHO ===========================================================================================
ECHO.
ECHO 1. WSR Report Folder Path
ECHO.
ECHO 2. Availability-Capacity Deck Folder Path
ECHO.
ECHO 3. Pre-CAB Checklist Folder Path
ECHO.
ECHO 4. Exit Lazy Planner
ECHO.
ECHO **************************************
set /p choice= Welcome! Please enter your choice:
rem if not '%choice%'=='' set choice=%choice:~0;1% ( don`t use this command, because it takes only first digit in the case you type more digits. After that for example choice 23455666 is choice 2 and you get "bye"
if '%choice%'=='' ECHO "%choice%" is not valid please try again
if '%choice%'=='1' start "\\Dell_BOI_MASS\Weekly Status Report\Work In Progress Report\" "\\Dell_BOI_MASS\Weekly Status Report\Work In Progress Report\"
if '%choice%'=='2' start "\\Dell_BOI_MASS\Service Design\Availability\Priyanka\2023\April2023\" "\\Dell_BOI_MASS\Service Design\Availability\Priyanka\2023\April2023\"
if '%choice%'=='3' start "\\Dell_BOI_MASS\Change Management\PRE PreCAB Quality Checks\Today\" "\\Dell_BOI_MASS\Change Management\PRE PreCAB Quality Checks\Today\"
if '%choice%'=='4' goto Exit
?
You werent far off of something usuable so im not 100% sure if this is what you are asking for but try this. hitting enter instead of typing anything sets the selection to default to
nothing