Windows Batch Program – Function and Procedure

Procedure


————————————————————-

:<Procedure Name>

<Algorithm>

goto:eof

————————————————————-

This is the standard template.

 

Example :

This script is used to get file modified date.

————————————————————-

:TalkALoud

Echo “This is the script”

goto:eof

————————————————————-

 

This script is used to get file modified date (%1 = parameter 1 ; %2 = parameter 2).

————————————————————-

:TalkALoud

Echo %1 %2

goto:eof

————————————————————-

 

 

Function


————————————————————-

:<Function Name>

<Algorithm>

goto:eof

————————————————————-

This is the standard template.

 

Example :

This script is used to get file modified date (%1 = parameter 1 ; %2 = parameter 2 ; RETURN_VARIABLE = Global Parameter). Globasl Variable is used to return parameter value.

————————————————————-

:TalkALoud

SET RETURN_VARIABLE=%1’%2

goto:eof

————————————————————-

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s