{"id":19901217,"url":"https://github.com/rbaltrusch/batch","last_synced_at":"2026-03-04T03:30:54.382Z","repository":{"id":134139560,"uuid":"304862781","full_name":"rbaltrusch/batch","owner":"rbaltrusch","description":"A collection of example batchfiles for Windows, including an explanatory wiki","archived":false,"fork":false,"pushed_at":"2023-10-08T11:39:36.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-08T07:42:43.370Z","etag":null,"topics":["batch","batch-script","batchfile","training","training-materials","wiki"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rbaltrusch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-10-17T11:30:48.000Z","updated_at":"2021-12-19T11:26:57.000Z","dependencies_parsed_at":"2023-11-13T14:00:17.650Z","dependency_job_id":null,"html_url":"https://github.com/rbaltrusch/batch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rbaltrusch/batch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaltrusch%2Fbatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaltrusch%2Fbatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaltrusch%2Fbatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaltrusch%2Fbatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rbaltrusch","download_url":"https://codeload.github.com/rbaltrusch/batch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rbaltrusch%2Fbatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30070743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch","batch-script","batchfile","training","training-materials","wiki"],"created_at":"2024-11-12T20:14:24.438Z","updated_at":"2026-03-04T03:30:54.367Z","avatar_url":"https://github.com/rbaltrusch.png","language":"Batchfile","readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT)\n\n# Windows Batchfiles\n\nThis repository is a collection of Windows batchfiles, primarily to practice batchfile syntax and test the various batch functionality available.\n\nThe targeted audience of this repository primarily is developers just getting started writing batchfiles. For developers only needing to accomplish simple tasks in the command line window, the [common workflow wiki page](https://github.com/rbaltrusch/batch/wiki/Common-workflow) should be enough to get started.\n\n## Contents\n\nThis repository contains files that test out:\n\n- most in-built batchfile commands\n- [variables](https://github.com/rbaltrusch/batch/wiki/Variables)\n- [function definitions](https://github.com/rbaltrusch/batch/wiki/Functions)\n\t- with local and global scopes\n- loops\n\t- [for loops](https://github.com/rbaltrusch/batch/wiki/For-loop)\n\t- while loops\n- [conditional logic](https://github.com/rbaltrusch/batch/wiki/Conditionals)\n- various other functionality, e.g.\n\t- user input\n\t- string manipulation\n\t- [redirection (piping)](https://github.com/rbaltrusch/batch/wiki/Redirection)\n\nA more detailed description of most concepts touched on here can be found in the [wiki](https://github.com/rbaltrusch/batch/wiki).\n\n#### In-built Commands\n\n1) batch_training.bat\n\t- Showcases a number of common built-in batchfile commands, such as *echo*, *cd*, *dir* and *md*. Note that this file is not meant to be run and only is a batch file to contain proper syntax highlighting. It exits early in case it is run.\n\n#### Functions\n1) function.bat\n\t- Showcases functions with local and global scope.\n1) function2.bat\n\t- Showcases a function with mixed scope.\n1) function3.bat\n\t- Showcases a function with local scope and a return value passed back to global scope, using the syntax:\n\n```batch\n\tsetlocal\n\tset /a var_from_local_scope=1\n\tendlocal \u0026 set var=%var_from_local_scope%\n```\n        \n#### Loops\n1) for_test.bat\n\t- Showcases the *for* keyword, with its various switches ( /l, /d, /r, /f ).\n1) for_with_label.bat\n\t- Showcases a for loop using *goto* labels.\n1) while_test.bat\n\t- Showcases a while loop using *goto* labels.\n        \n#### Other\n\nThis section contains various other scripts, including conditional statements, user input, **file redirection (piping)**, and other functionality.\n\n1) choice_test.bat\n1) conditionals.bat\n1) delayedexpansion.bat\n1) delayedexpansion_without_setlocal.bat\n1) input_test.bat\n1) random_number.bat\n1) redirection.bat\n1) script_with_args.bat\n1) string_substitution.bat\n1) substring.bat\n\n## Getting started\n\nTo get a copy of this repository, simply open up git bash in an empty folder and use the command:\n\n\t\t$ git clone https://github.com/rbaltrusch/batch\n\n## Contributions\n\nAny contributions, such as additional features, bugfixes, or documentation are much appreciated. Contribution guidelines are specified in [CONTRIBUTING.md](https://github.com/rbaltrusch/batch/blob/master/CONTRIBUTING.md).\n\n## License\n\nThis repository is open-source software available under the [MIT license](https://github.com/rbaltrusch/batch/blob/master/LICENSE)\n\n## Contact\n\nPlease raise an issue for code changes. To reach out, please send an email to richard@baltrusch.net.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbaltrusch%2Fbatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frbaltrusch%2Fbatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frbaltrusch%2Fbatch/lists"}