Batch Script File
Tutorial 1 :-
Audience
This tutorial has been prepared for beginners to understand the basic concepts of Batch Script.Prerequisites
A reasonable knowledge of computer programming and concepts such as variables, commands, syntax, etc. is desired.Batch Script – Overview
Batch Script is incorporated to automate command sequences which are repetitive in nature. Scripting is a way by which one can alleviate this necessity by automating these command sequences in order to make one’s life at the shell easier and more productive. In most organizations, Batch Script is incorporated in some way or the other to automate stuff.
Some of the features of Batch Script are −
Running a batch file is a simple matter of just clicking on it. Batch files can also be run in a command prompt or the Start-Run line. In such case, the full path name must be used unless the file's path is in the path environment. Following is a simple example of a Batch Script. This Batch Script when run deletes all files in the current directory.
Some of the features of Batch Script are −
- Can read inputs from users so that it can be processed further.
- Has control structures such as for, if, while, switch for better automating and scripting.
- Supports advanced features such as Functions and Arrays.
- Supports regular expressions.
- Can include other programming codes such as Perl.
- Setting up servers for different purposes.
- Automating housekeeping activities such as deleting unwanted files or log files.
- Automating the deployment of applications from one environment to another.
- Installing programs on various machines at once.
Running a batch file is a simple matter of just clicking on it. Batch files can also be run in a command prompt or the Start-Run line. In such case, the full path name must be used unless the file's path is in the path environment. Following is a simple example of a Batch Script. This Batch Script when run deletes all files in the current directory.
:: Deletes All files in the Current Directory With Prompts and Warnings ::(Hidden, System, and Read-Only Files are Not Affected) :: @ECHO OFF DEL . DR
:: Deletes All files in the Current Directory With Prompts and Warnings ::(Hidden, System, and Read-Only Files are Not Affected) :: @ECHO OFF DEL . DR
0 comments:
Post a Comment
For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.