https://github.com/mlabbe/batchargs
Use equals signs in batch file arguments.
https://github.com/mlabbe/batchargs
Last synced: about 1 year ago
JSON representation
Use equals signs in batch file arguments.
- Host: GitHub
- URL: https://github.com/mlabbe/batchargs
- Owner: mlabbe
- License: mit
- Created: 2014-06-17T20:30:05.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-06-17T20:37:01.000Z (about 12 years ago)
- Last Synced: 2025-02-15T22:42:10.081Z (over 1 year ago)
- Language: Shell
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BatchArgs #
You cannot use equals '=' in arguments passed to a batch file. Passing this:
somebat.bat a=b
Is tantamount to outputting this:
somebat.bat a b
## Solution ##
`batchargs.bat` works around this by converting double underscores to equals signs. Copy and paste the code from `batchargs.bat` into your batch file, so that:
somebat.bat a__b
Equals this:
somebat.bat a=b
## Usage ##
Once the loop is finished, the global variable `%args%` is set to the full list of args.
If there are parameters you do not want to convert, use shift to get rid of them.