Keyword Search
Site Map
Help Request Form
Send Mail
. . . I n t e r l o p e r s W e b s p a c e

 



What's New
Send A Note
View Guestbook

Batch Commands

Here are a few general commands:
Note: Items in [] are optional.

Echo [on/off] [text]
Turns display on or off.

Echo.
Displays a blank line.

Cls
Clears the display.

Pause
Stops, waits for key press.

:name
A Label.

Goto name
Jumps there.

If [true/false] [action]
Logic test, then action if true.

Call batch file
Use to run another batch file.

Choice [/c:choices] [/T:c,nn] [query]
Requests user input.


Bypass Startup Files

TIP: To bypass your startup files:

For Windows 3.x, press

F5
when you see
'Loading MS-DOS...'
(This will go to a DOS prompt).

For Windows 95/98, press

F8
when you see
'Starting Windows 95...'
(This brings up the Start Menu).

 

Tips Index
MS-DOS Win 3.xx Win 95 Internet

 

DOS - Sample File
Peak Your System Performance
and
Your Computer Expertise

 


|| Tips Index || DOS : Navigation | Memory | Hard Disk
Configuration | Auto Execute | Batch | Misc

Here is a sample menu program to help you see how to use batch file commands. You can cut'n paste these to use for practice. Save them with the names given, then at a dos prompt, type mymenu to bring up your menu batch file.

Sample Menu Batch File

	Filename: 'mymenu.bat'
-------- Start cut to paste here --------
@echo off
:top
cls
Echo.
Echo My Main Menu
Echo ============
Echo DOS (P)rompt
Echo (W)indows
Echo DOS (S)hell
Echo.
Choice /c:pws /t:p,10 Which Environment
If errorlevel 3 goto shlrun
If errorlevel 2 goto winrun
If errorlevel 1 goto dosrun
:shlrun
call dosshell.bat
pause
goto top
:winrun
call windows.bat
pause
goto top
:dosrun
prompt Type 'mymenu' for Main Menu$_$p$g
--------- End cut to paste here --------

 
	Filename: 'windows.bat'
------- Start cut to paste here --------
@echo off
cd\windows
win
--------- End cut to paste here --------

By also creating a windows.bat file you can return to your menu when you close Windows (exist to a DOS prompt in Windows 95).

If you do not have the dosshell.bat or windows.bat files, the program will simply report a bad command and then continue. You can replace these names with the start commands for your own programs (don't forget to edit the menu text and choice letters).

This file modifies the prompt when it exits to DOS. To restore your original prompt, go to a DOS prompt and type prompt $p$g.


If you create a menu you want to see every time your system starts, edit the autoexec.bat file. Add the batch file name on a line just above the line with win.com, then save it, and restart your computer.

 

. . . I n t e r l o p e r s W e b s p a c e
1