the file with subroutines must look like:
@echo off
call :%*
exit /b %errorlevel%
:hello
echo in hello
exit /b 0
:Demo
echo in Demo with argument %1
exit /b 0
then from the other file you can call it like
call file2.bat demo "arg-one"
More Related Contents:
- Batch file comparison of variable with constant fails
- What does %~dp0 mean, and how does it work?
- How to run multiple .BAT files within a .BAT file
- Assign output of a program to a variable using a MS batch file
- Time is set incorrectly after midnight
- Why doesn’t this FINDSTR example with multiple literal search strings find a match?
- What is the difference between % and %% in a cmd file?
- How Should I Set Default Python Version In Windows?
- How to read and print contents of text file line by line?
- How to wait in a batch script? [duplicate]
- (Windows batch) Goto within if block behaves very strangely
- Windows batch command(s) to read first line from text file
- What does single-quoting do in Windows batch files?
- How to search and replace a string in environment variable PATH?
- Batch Command to catch all possible ping issues
- What does “&&” do in this batch file?
- Batch Extract path and filename from a variable
- batch file – counting number of files in folder and storing in a variable
- Drag and drop batch file for multiple files?
- Batch / Find And Edit Lines in TXT file
- Waiting for parallel batch scripts
- Why does ‘Run as administrator’ change (sometimes) batch file’s current directory?
- Batch file to copy files from one folder to another folder
- batch echo pipe symbol causing unexpected behaviour
- Why does the command XCOPY in batch file ask for file or folder?
- Why are Danish characters not displayed as in text editor on executing batch file?
- How can I escape an exclamation mark ! in cmd scripts?
- How do I make one particular line of a batch file a different color then the others?
- Safest way to run BAT file from Powershell script
- How to code a spinner for waiting processes in a Batch file?