-
Notifications
You must be signed in to change notification settings - Fork 3
/
shellinfo.bat
67 lines (49 loc) · 1.36 KB
/
shellinfo.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
:: ========================================================================
::
:: This file is a helper script to show some specific environment
:: variables such as %PATH% and families %FAR*%, %ConEmu*% and %*HOME%.
::
:: ========================================================================
@echo off
if /i "%~1" == "list" goto :shellinfo_list
if "%~1" == "" (
echo:Show the actual environment ^(variables and/or aliases^)
echo:
echo:Usage:
echo:%~n0 PATTERN ...
echo:
echo:Available patterns:
call :shellinfo_list
goto :EOF
)
:shellinfo_loop_1
if "%~1" == "" goto :EOF
for /f %%m in ( '"%~f0" list' ) do if /i "%~1" == "%%m" call :shellinfo.%%m & echo:
shift /1
goto :shellinfo_loop_1
:: ========================================================================
:shellinfo_list
for /f "tokens=2 delims=." %%p in ( 'findstr /i /b ":shellinfo\." "%~f0"' ) do echo:%%~p
goto :EOF
:: ========================================================================
:shellinfo.set
set
goto :EOF
:shellinfo.path
for %%a in ( "%PATH:;=" "%" ) do echo:%%~a
goto :EOF
:shellinfo.doskey
:shellinfo.alias
doskey /macros
goto :EOF
:shellinfo.home
set | findstr /i /b "[^=]*HOME="
goto :EOF
:shellinfo.conemu
set | findstr /i /b "ConEmu"
goto :EOF
:shellinfo.far
set | findstr /i /b "FAR"
goto :EOF
:: ========================================================================
:: EOF