Spiga

DOS & BATCH PROGRAMMING TIPS






Ms Dos And Batch File Programming Tricks And Tips

DOS is basically a file caled command.com .It is this file which handles all DOS commands that we give at DOS prompt-such as copy,dir,del,etc.

Batch file programming is nothing but the windows version of unix shell programming.To perform a bulk set of commands over and over again,batch files are used.

Some Important And Hidden Dos Command
1>ANSI.SYS - Defines functions that change display graphics, control cursor movement, and
reassign keys.
2>ARP - Displays, adds, and removes arp information from network devices
3>AT - Schedule a time to execute commands or programs.
4>COLOR - Easily change the foreground and background color of the MS-DOS window.
5>CONTROL - Open control panel icons from the MS-DOS prompt.
6>CTTY - Change the computers input/output devices.
7>EMM386 - Load extended Memory Manager.
8>IFSHLP.SYS - 32-bit file manager.
9>SWITCHES - Remove add functions from MS-DOS.
10>SYS - Transfer system files to disk drive.

Redirection Of OUTPUT:
Send the output of the dos prompt to a file on disk.This can be done using the Redirection operator,> .
Example: c:\windows>net>xyz.txt
c:\windows>help>>xyz.txt
This command will execute the net command and will store the results in the
text file ,xyz.txt.
To print the results: c:\windows>dir*.*>prn

Redirection of Input:
we can also redirect input ,from .txt file to DOS prompt.
Example: c:\windows> more <>

BATCH PROGRAM TO DELETE FILES:

@ECHO OFF
ECHO.
ECHO I am going to delete the following files:
ECHO %1 %2
ECHO.
ECHO CTRL+C to Abort Process
PAUSE
FOR %%A IN (%1 %2) DO DEL %%a
ECHO Killed files.Mission Accomplished By Sonu Mishra.

0 comments: