You need to define
enter at the top of your code.
Don't blame the IF structure.
In batch and in Ch and C you must define or set variables at the start. With a few exceptions.
As for distribution, Ch is so close to C or C++ that you should be able to compile it and distribute it asa an EXE file after you have the code perfected. But If you want others to help you with it, you can give them the link to the free CH IDE.
Here are three resins I would recommend Ch rather that batch as a general tool.
• It has structure closer to C/C++ and can be ported to other platforms.
• It is a better learning tool that batch.
• It comes with a nice IDE. (Integrated Development Environment)
But if you want to use batch. bot ahead. Every time you have a IF statement there must be a GOPTO after it. Unless you are very clever.
BTW, there is also
Tiny C,which has a very long history. It can be compiled.
http://bellard.org/tcc/It does very compact x86 code.