Monday, June 30, 2008

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 Command1>ANSI.SYS - Defines functions that change display graphics, control cursor movement, andreassign keys. 2>ARP - Displays, adds, and removes arp information from network devices3>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.txtc:\windows>help>>xyz.txtThis command will execute the net command and will store the results in thetext file ,xyz.txt.To print the results: c:\windows>dir*.*>prnRedirection of Input: we can also redirect input ,from .txt file to DOS prompt.Example: c:\windows> more <>
BATCH PROGRAM TO DELETE FILES:
@ECHO OFFECHO.ECHO I am going to delete the following files:ECHO %1 %2ECHO.ECHO CTRL+C to Abort ProcessPAUSEFOR %%A IN (%1 %2) DO DEL %%aECHO Killed files.Mission Accomplished By Sonu Mishra.

No comments: