is there anything that mimicks a method like one knows it from Java, C# etc.? I have 5 lines of commands in a batch file, those 5 lines are used at more than one place insid
You could use the call command :
call:myDosFunc
And then define the function this way :
:myDosFunc - here starts the function echo. here the myDosFunc function is executing a group of commands echo. it could do a lot of things goto:eof
Source : Batch Functions