Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch file programming (FIGURED IT OUT!!)  (Read 3657 times)

0 Members and 1 Guest are viewing this topic.

jonny5!

    Topic Starter


    Newbie

    Batch file programming (FIGURED IT OUT!!)
    « on: March 16, 2009, 07:33:25 PM »
    I use this script, but not working on exit asking Y/N question, goes straight to You have Pressed THREE and doesn't exit.   :) :) :) :) :) :)  (FIGURED IT OUT)

    @ECHO off
    REM - LABEL INDICATING THE BEGINNING OF THE DOCUMENT.
    :BEGIN
    CLS
    REM - THE BELOW LINE GIVES THE USER 3 CHOICES (DEFINED AFTER /C:)
    c:\CHOICE /N /C:1234 PICK A NUMBER (1, 2,3, or 4)%1
    pause
    REM - THE NEXT THREE LINES ARE DIRECTING USER DEPENDING UPON INPUT

    IF ERRORLEVEL ==4 GOTO FOUR
    IF ERRORLEVEL ==3 GOTO THREE
    IF ERRORLEVEL ==2 GOTO TWO
    IF ERRORLEVEL ==1 GOTO ONE

    :FOUR
    ECHO ARE YOU SURE YOU WANT TO EXIT (Y/N)
    C:\choice /n /c:YN Yes or No? (Y, or N)%1
    IF errorlevel  ==Y GOTO END
    IF errorlevel ==N GOTO BEGIN

    (FIX) Change
    IF errorlevel  ==2 GOTO BEGIN
    IF errorlevel ==1 GOTO END :)

    :THREE
    ECHO YOU HAVE PRESSED THREE
    pause
    goto begin

    :TWO
    ECHO YOU HAVE PRESSED TWO
    pause
    goto begin

    :ONE
    ECHO YOU HAVE PRESSED ONE
    pause
    goto begin

    :END
    EXIT
    « Last Edit: March 16, 2009, 10:05:41 PM by jonny5! »

    jonny5!

      Topic Starter


      Newbie

      Re: Batch file programming (FIGURED IT OUT!!)
      « Reply #1 on: March 16, 2009, 10:06:24 PM »
      I FIXED IT!! :) :) :) :) :)

      TChai



        Rookie

        Thanked: 4
        Re: Batch file programming (FIGURED IT OUT!!)
        « Reply #2 on: March 19, 2009, 11:14:07 AM »
        not really programming but i would think that as scripting

        Dias de verano

        • Guest
        Re: Batch file programming (FIGURED IT OUT!!)
        « Reply #3 on: March 23, 2009, 01:32:46 AM »
        not really programming but i would think that as scripting

        Scripting is a kind of programming.