How to press enter to continue

Closed
dosnoob Posts 1 Registration date Thursday February 14, 2013 Status Member Last seen February 14, 2013 - Feb 14, 2013 at 04:53 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Feb 14, 2013 at 06:34 AM
Hello,

I hope I can get some help on dos programming as there's no specific forum on dos programming

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:\bob_backup\bugfixes\29340>extract_listener_port.bat

D:\bob_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!

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Feb 14, 2013 at 06:34 AM
some thing like this


@ECHO OFF
SET /P dummy="***Press <ENTER> to retain the Current value : "
IF "%dummy%"=="" GOTO Retained
ECHO value not retained
GOTO End
:Retained
ECHO Value Retained
:End
0