CMD/Batch scripting for Windows recipes
Windows recipes rely on CMD/Batch scripts (.bat) by default.
Batch syntax is a bit different from Bash and friends on Unix, so we have collected some tips here to help you get started if you are not familiar with this scripting language.
- Check if you need to write a Batch script first!
Simple recipes might not need shell-specific code and can be written in an agnostic way.
Use the
build.scriptitem inmeta.yaml(see conda-build docs). This item can take a string or a list of strings (one per line). - SS64's CMD howto pages are the best resource for any kind of question regarding CMD/Batch syntax.
- Search conda-forge for existing
.batscripts and learn with examples. See this example query for all Batchfiles. - You can get free trial Windows VMs from Microsoft. Set one up with your favorite virtualization solution to debug your CMD syntax. There are also some minimal emulators online that might get you started with the basics, even if not all CMD features are present. For example, this Windows 95 emulator features a more or less okay MS-DOS prompt.