Results 1 to 5 of 5

Thread: I need help with DOS commands

  1. #1
    Join Date
    May 2011
    Posts
    4

    I need help with DOS commands

    Hi,

    Does anybody know how to extract the value that is enterd at the blinking cursor in DOS. I am just a beginner at this. I have batch file that gives some options and then i use the pause command to keep the cursor at one point for user input. How can i extract this value to execute my other statements based on this value...

    the code i have written is this... i know i am just playing around, but i want to learn stuff..

    Code:
    @echo off
    :start
    echo Hello, Here are some Batch File Options:
    echo ========================================
    echo 1. Calculator
    echo 2. Internet Explorer
    echo 3. Other
    echo 4. Quit
    echo ========================================
    here:
    echo Enter numeral options...
    %1
    set op=%1
    @pause >nul
    shift
    if op==1 goto option1
    else if op==2 goto option2
    else if op==3 goto option3
    else if op==4 goto option4
    :option1
    start calc.exe
    goto here
    :option2
    start iexplore.exe
    goto here
    :option3
    start cmd.exe
    goto here
    :option4
    exit
    @echo on
    I think my main issue is extracting the input.. if its some toher issue, please let me know.

    Cheers.

  2. #2
    Join Date
    Apr 2010
    Posts
    173

    Re: I need help with DOS commands

    You are able to open the command terminal within windows commencing the START menu and choose RUN and type command inside the box to open the terminal and go into the commands to achieve the task. The commands would be connected through the name of the file or additional related selection and what the command necessitate entering. If you don't be acquainted with whatever thing regarding the commands after that you one of the commands is utilize to obtain information regarding commands is recognized as HELP.

  3. #3
    Join Date
    May 2011
    Posts
    4

    Re: I need help with DOS commands

    By God's grace i've figured it out... solved the issue. I had made a mistake in the syntax...

    the corrected code is as follows.
    Code:
    @echo off
    :start
    cls
    echo Hello, Here are some Batch File Options:
    echo ========================================
    echo 1. Calculator
    echo 2. Internet Explorer
    echo 3. Other
    echo 4. Quit
    echo ========================================
    set /p op=Enter numeral options...
    shift
    if "%op%" == "1" goto option1
    if "%op%" == "2" goto option2
    if "%op%" == "3" goto option3
    if "%op%" == "4" goto option4
    :option1
    start calc.exe
    goto start
    :option2
    start iexplore.exe
    goto start
    :option3
    start cmd.exe
    goto start
    :option4
    exit
    @echo on
    NOTE: this is open-source and anyone is free to copy this code and use it for good purposes.

    Cheers,

    Trev

  4. #4
    Join Date
    Nov 2008
    Posts
    1,185

    Re: I need help with DOS commands

    So finally you got it and you have solved you issue good and yes thank you very much for searing this code with everyone over here.

  5. #5
    Join Date
    Jan 2005
    Location
    home
    Posts
    39

    Re: I need help with DOS commands

    cool man.. it helped me to customize my own way

Similar Threads

  1. MS-DOS help and commands
    By Kalyug in forum Operating Systems
    Replies: 8
    Last Post: 24-05-2011, 12:39 AM
  2. MS-DOS top 10 commands
    By Roasted in forum Operating Systems
    Replies: 4
    Last Post: 27-03-2010, 06:19 PM
  3. Run Commands for Win XP
    By Rohit Kasle (RK) in forum Tips & Tweaks
    Replies: 1
    Last Post: 06-02-2010, 10:15 AM
  4. Need Basic Dos commands for Commands prompt
    By JangoRap in forum Operating Systems
    Replies: 5
    Last Post: 29-06-2009, 12:07 PM
  5. Useful DNS Commands
    By K.gupta in forum Guides & Tutorials
    Replies: 3
    Last Post: 10-08-2005, 09:16 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,286,021.84039 seconds with 17 queries