Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • +1, but I love the endlocals when setlocal is used :-).It's more neat. Commented Nov 6, 2013 at 9:09
  • @npocmaka : I agree. I've not included it thinking batch file will need more content. Anyway, endlocal is implicit and at end of batch file execution, any pending setlocal is canceled. It's only mandatory if you need to ensure, after a setlocal has been emited, that changes to environment variables persist. BUT, yes, i prefer balanced code. Commented Nov 6, 2013 at 9:19