How do I declare a global variable in a batch script?
Example:
Test1.bat:
set testvar=C:\Windows
echo %testvar%
Now I should be able to use this testvar in other batch script (test2.bat)
Test2.bat:
echo %testvar%
Thanks and Regards!
By setting a system environment variable permanently. See here.
Applies To: Windows Server 2008, Windows Vista
For Windows XP download and install Windows XP Service Pack 2 Support Tools
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With