1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

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

Discussion in 'DOS/Other' started by dosjediwannabe, Feb 14, 2013.

Thread Status:
Not open for further replies.
  1. dosjediwannabe

    dosjediwannabe Thread Starter

    Joined:
    Feb 14, 2013
    Messages:
    1
    Hello,

    here's my code

    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:

    Code:
    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
     
  2. foxidrive

    foxidrive Banned

    Joined:
    Oct 20, 2012
    Messages:
    793
    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.
     
  3. palogamers

    palogamers

    Joined:
    Feb 16, 2013
    Messages:
    1
    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
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - ensure need enter
  1. gbmktg
    Replies:
    11
    Views:
    751
  2. geno368
    Replies:
    7
    Views:
    529
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1089444

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice