BATCH SCRIPTING// FUNCTIONS IN BATCH SCRIPT // Batch Scripting Part -20- FUNCTIONS

Veröffentlicht am: 02 Juli 2020
auf dem Kanal: Techno Puffin
979
11

Go and check out course on Udemy for PowerShell:
https://www.udemy.com/course/powershe...
********************************************************************************************
Title: BATCH SCRIPTING// FUNCTIONS IN BATCH SCRIPT // Batch Scripting Part 20 FUNCTIONS

In this lesson, you will be learning about FUNCTIONS IN BATCH SCRIPT .


FUNCTION: A function is a set of statements organized together to perform a specific task. In batch scripts, a similar approach is adopted to group logical statements together to form a function.


As like any other languages, functions in Batch Script follows the same procedure −


Function Declaration − It tells the compiler about a function's name, return type, and parameters.


Function Definition − It provides the actual body of the function.


In Batch Script, a function is defined by using the label statement. When a function is newly defined, it may take one or several values as input 'parameters' to the function, process the functions in the main body, and pass back the values to the functions as output 'return types'.


Every function has a function name, which describes the task that the function performs. To use a function, you "call" that function with its name and pass its input values (known as arguments) that matches the types of the function's parameters.


Following is the syntax of a simple function.


:function_name
Do_something
EXIT /B 0
The function_name is the name given to the function which should have some meaning to match what the function actually does.


The EXIT statement is used to ensure that the function exits properly.


Following is an example of a simple function.


Example
:Display
SET /A index=2
echo The value of index is %index%
EXIT /B 0
=======================================================
If you have any questions, please post them. Don't forget to comment, like, rate and subscribe
=====================================================
Batch file programming tutorial // CREATE BATCH FILE // Batch Scripting Part-1 --    • Batch file programming tutorial // CR...  
Batch file programming tutorial // Batch Scripting Part-2 - Basic Batch Commands --    • Batch file programming tutorial // Ba...  
Batch file programming tutorial // COPY COMMAND // Batch Scripting Part-3 - COPY Batch Command --    • Batch file programming tutorial // CO...  
Batch file programming tutorial // DEL COMMAND // Batch Scripting Part-4 - DEL Batch Command --    • Batch file programming tutorial // DE...  
Batch file programming tutorial // MOVE COMMAND // Batch Scripting Part-5 - MOVE Batch Command --    • Batch file programming tutorial //MOV...  
Batch file programming tutorial // ATTRIB COMMAND // Batch Scripting Part-6 - ATTRIB Batch Command --    • Batch file programming tutorial // AT...  
Batch file programming tutorial // FIND COMMAND // Batch Scripting Part-7 - FIND Batch Command --    • Batch file programming tutorial // FI...  
Batch file programming tutorial // VARIABLES IN BATCH SCRIPT // Batch Scripting Part- 8 - VARIABLES --    • Batch file programming tutorial // VA...  
DO NOT CLICK // LOCAL AND GLOBAL VARIABLES IN BATCH SCRIPT // Part- 9 - LOCAL AND GLOBAL VARIABLES --    • DO NOT CLICK // LOCAL AND GLOBAL VARI...  
BATCH SCRIPTING // STRINGS IN BATCH SCRIPT // Batch Scripting Part- 10 - STRINGS --    • BATCH SCRIPTING // STRINGS IN BATCH S...  
BATCH SCRIPTING// LEFT, MID AND RIGHT STRINGS// Batch Scripting Part- 11- LEFT, MID AND RIGHT STRING --    • BATCH SCRIPTING// LEFT, MID AND RIGHT...  
REMOVE AND REPLACE IN STRING // Batch Scripting Part 12 REMOVE AND REPLACE IN STRING --    • REMOVE AND REPLACE IN STRING // Batch...  
BATCH SCRIPTING// ARRAYS // Batch Scripting Part 13 ARRAYS --    • BATCH SCRIPTING// ARRAYS // Batch Scr...  
BATCH SCRIPTING// MODIFY AND ITERATE OVER AN ARRAYS // Batch Scripting Part 14 MODIFY AND ITERATE --    • BATCH SCRIPTING// MODIFY AND ITERATE ...  
BATCH SCRIPTING// LENGTH OF AN ARRAY // Batch Scripting Part 15 LENGTH OF AN ARRAY --    • BATCH SCRIPTING// LENGTH OF AN ARRAY ...  
BATCH SCRIPTING// IF CONDITION // Batch Scripting Part 16 IF CONDITION --    • BATCH SCRIPTING// IF CONDITION // Bat...  
BATCH SCRIPTING// IF/ELSE CONDITION // Batch Scripting Part 17 IF/ELSE CONDITION --    • BATCH SCRIPTING// IF/ELSE CONDITION /...  
BATCH SCRIPTING// NESTED IF CONDITION // Batch Scripting Part 18 NESTED IF CONDITION --    • BATCH SCRIPTING// NESTED IF CONDITION...  
BATCH SCRIPTING// OPERATORS IN BATCH SCRIPT // Batch Scripting Part 19 OPERATORS --    • BATCH SCRIPTING// OPERATORS IN BATCH ...  
======================================================
Check out other videos


WEAPONS THAT CAN DEFEAT THANOS -- https://www.youtube.com/watch?v=nvlez
MS PAINT TRICK -- https://www.youtube.com/watch?v=4IvBC
Matrix Effect --    • Matrix Rain Best Trick// Create Matri...  
CMD: Wi-Fi Password Hack| Find WiFi Password on Windows 10/8/7/XP --    • Video  


Auf dieser Seite können Sie das Online-Video BATCH SCRIPTING// FUNCTIONS IN BATCH SCRIPT // Batch Scripting Part -20- FUNCTIONS mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Techno Puffin 02 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 979 Mal angesehen und es wurde von 11 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!