This page is edited from the 1cmdfaq.txt faq-file contained in
my tscmd.zip
command line interface (CLI) collection. That zipped file has much
additional material, including a number of detached .cmd script
files. It is recommended that you also get the zipped version as a
companion.
Please see "
The Description and
the Index page" for the conditions of usage and other such
information.
173} How do I get the original GUI path since CLI's may be changed?
@echo off & setlocal enableextensions
:: System-wide
for /f "tokens=2,*" %%a in ('
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\"
^|findstr "Path"^|findstr "REG_EXPAND_SZ"') do echo %%b
echo.
:: User specific
for /f "tokens=2,*" %%a in ('
reg query "HKEY_CURRENT_USER\Environment\"
^|findstr "PATH"^|findstr "REG_EXPAND_SZ"') do echo %%b
endlocal & goto :EOF
GUI = graphical user interface
CLI = command line interface
@echo off & setlocal enableextensions
echo %%USERNAME%%=%USERNAME%
echo.
echo %path%
pause
endlocal & goto :EOF