::
=======================================================================
::
GetEnvVars.bat
::
=======================================================================
::
Get all environment variables and their values from one batch
file.
:: Have you used the example from the help for Microsoft
FOR command?
:: FOR /F "usebackq delims==" %i IN (`set`) DO @echo
%
:: Here is a way to get the list of variables and their values
dynamically.
::
=======================================================================
::
Jerome Christopher. [Jerome_christopher@yahoo.com]
:: http://htmsql.blogspot.com/
:: http://www.sqlhtm.com/sqlhtm/selfrunner
::
=======================================================================
@echo
off
del c:\gevl.tmp2.out
del c:\gev1.tmp1.out
(
echo ^(
echo echo ::
Generating the Environment Variables and their values...
echo
echo :: Find the output in c:\gev1.tmp1.out
echo echo ^@echo
off
echo FOR ^/F ^"usebackq delims^=^=^"
%%%%i IN ^(^`set^`^) DO ^@echo echo %%%%i ^= %%%%%%%%i%%%%%
echo ^) ^>
^c:^\gev1.tmp1.bat
)>c:\gev1.tmp2.bat
cmd /c
c:\gev1.tmp2.bat>c:\gevl.tmp2.out
cmd /c
c:\gev1.tmp1.bat>c:\gev1.tmp1.out
exit