SelfRunner

SelfRunnerOdbc

TwoPanelQueryCollection

TwoPanelInlineQueries

TwoPanelTabIndSizeNumRows

TwoPanelTabIndLastAnalyzed

TwoPanelTableDataCompare

CreRunSchemaNumRows

CreRunNumRowsAllDbTab

MakeHtm

MakeHta

GetEnvVars

Click on the image for a bigger view

GetEnvVarsSampleOutput.jpg


One-liner
to get
windows environment variables
and their values.
 

GetEnvVars.bat
One-liner to get Windows environment variables and their values.

There are times, in Oracle or outside of it, when we need to know values of Windows environment variables like user domain for use in scripts.

Here is a little batch script to dynamically generate environment variable names and their values in one go. This script uses the example from the Microsoft FOR command help.

Here is the script:


:: =======================================================================
:: 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

   

Home

Scripts

Tips

Misc

Resume

Tamil

JobSearch

www.sqlhtm.com Copyright Jerome S. Christopher 2010