Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



I need help with DOS commands

Operating Systems


Reply
 
Thread Tools Search this Thread
  #1  
Old 15-05-2011
Member
 
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.

Reply With Quote
  #2  
Old 15-05-2011
Member
 
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.
Reply With Quote
  #3  
Old 16-05-2011
Member
 
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
Reply With Quote
  #4  
Old 16-05-2011
Member
 
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.
Reply With Quote
  #5  
Old 17-05-2011
Member
 
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
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 08:43 PM.