# how do I ensure that I need to enter "enter" to exit the program?



## dosjediwannabe (Feb 14, 2013)

Hello,

here's my code


```
echo off 

set LISTENER_FILE=%ORACLE_HOME%\network\admin\listener.ora 

rem for /f "tokens=7 delims=)= " %%a in ('find "(PORT =" ^<listener.ora') do echo %%a 

for /f "tokens=7 delims=)= " %%a in ('find "(PORT =" ^<%LISTENER_FILE%') do ( 
  rem echo %%a 
  set EXISTING_PORT=%%a 
) 

rem echo %EXISTING_PORT% 


 if (%LISTENER_PORT%)==() if (%EXISTING_PORT%)==() ( 
  echo "***Enter LISTENER_PORT (only applicable to new listener) : ") else ( 
    echo "***Current LISTENER_PORT =%EXISTING_PORT%" 
      echo "***Press <ENTER> to retain the Current value : " 
  ) 

rem found in excel_db.bat start 


if (%EXISTING_PORT%)==()  ( 
   set ACTUAL_PORT=%LISTENER_PORT%    
  ) else (     
    set ACTUAL_PORT=%EXISTING_PORT% 
  ) 

echo  "ACTUAL_PORT %ACTUAL_PORT%" 

choice /c:123456789 

if ERRORLEVEL==9 goto exit 
if ERRORLEVEL==8 goto excel_with_partition 
if ERRORLEVEL==7 goto enable_uem 
if ERRORLEVEL==6 goto reload_schema_import 
if ERRORLEVEL==5 goto reload_schema_with_partition 
if ERRORLEVEL==4 goto reload_schema 
if ERRORLEVEL==3 goto drop_schema 
if ERRORLEVEL==2 goto new_excel_import 
if ERRORLEVEL==1 goto new_excel 

:excel_with_partition 
exit 

:enable_uem 
exit 

:reload_schema_import 
exit 

:reload_schema_with_partition 
exit 

:reload_schema 
exit 

:drop_schema 
exit 

:new_excel_import 
exit 

:new_excel 
exit 

:exit 
rem pause 


rem found in excel_db.bat end   
rem pause
```
The output is as follow:


```
D:\william_backup\bugfixes\29340>extract_listener_port.bat 

D:\william_backup\bugfixes\29340>echo off 
"***Current LISTENER_PORT =1521" 
"***Press <ENTER> to retain the Current value : " 
 "ACTUAL_PORT 1521" 
'choice' is not recognized as an internal or external command, 
operable program or batch file.
```
my question is how do I ensure that I need to enter "enter" to exit the program?

thanks a lot!

thanks


----------



## foxidrive (Oct 20, 2012)

You don't have a choice command. XP doesn't have one natively but you can download one.

I told you about another issue on another forum, where you have the same topic open.


----------



## palogamers (Feb 16, 2013)

just use something like this 
echo YourMessage
set /p Variable=
the set /p put the batc/command line in user input mode and assign the response from user into the variable provided


----------

