forked from npocmaka/batch.scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistBrowsers.bat
98 lines (83 loc) · 2.43 KB
/
listBrowsers.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@echo off
:: list installed browsers
:: uses regedit so it's compatible with windows XP
setlocal enableExtensions
echo.
echo.
echo INSTALLED BROWSERS
echo.
echo.
rem :::::::::::::::::::::::::::::::::::::::::::::::::::::
rem :: exporting registry values for installed browsers
rem :::::::::::::::::::::::::::::::::::::::::::::::::::::
rem for 64 bit systems
START /W REGEDIT /E "%Temp%\BROW3.reg" HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Clients\StartMenuInternet
rem for 32 bit systems
if not exist "%Temp%\BROW3.reg" START /W REGEDIT /E "%Temp%\BROW3.reg" HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet
setLocal enableDelayedExpansion
for /f "tokens=*" %%B in ('type "%Temp%\BROW3.reg" ^| findstr /E "DefaultIcon]"') do (
rem extracting browser name from icon path
set "browser=%%B"
rem removing \DefaultIcon] string
set "browser=!browser:\DefaultIcon]=!"
rem get the browser name
for %%P in ("!browser!") do echo %%~nP
)
endLocal
echo.
echo.
echo EXECUTABLES PATHS
echo.
echo.
setLocal enableDelayedExpansion
for /f "tokens=* delims=@=" %%B in ('type "%Temp%\BROW3.reg" ^| findstr /B "@" ^| findstr /E ".exe\\\",0\"^"') do (
set "browser=%%~B"
set "browser=!browser:\\=\!"
echo !browser!
)
setLocal enableDelayedExpansion
for /f "tokens=* delims=@=" %%B in ('type "%Temp%\BROW3.reg" ^| findstr /B "@" ^| findstr /E ".exe,0\"^"') do (
set "browser=%%~B"
set "browser=!browser:\\=\!"
set "browser=!browser:,0=!"
echo !browser!
)
endLocal
rem delete temp file
del /Q /F "%Temp%\BROW3.reg"
echo.
echo.
echo DEFAULT BROWSER
echo.
echo.
START /W REGEDIT /E "%Temp%\BROW5.reg" HKEY_CLASSES_ROOT\http\shell\open\command
setLocal enableDelayedExpansion
for /f tokens^=3^ delims^=^" %%B in ('type "%Temp%\BROW5.reg" ^| find "@"') do (
set "default=%%B"
rem removing double slashes
set "default=!default:\\=\!"
rem removing end slash
set "default=!default:~0,-1!"
rem get the name
for %%D in ("!default!") do echo %%~nD
)
endLocal
del /Q /F "%Temp%\BROW5.reg"
echo.
echo.
echo DEFAULT .HTML VIEWER
echo.
echo.
START /W REGEDIT /E "%Temp%\BROW6.reg" HKEY_CLASSES_ROOT\htmlfile\shell\open\command
setLocal enableDelayedExpansion
for /f tokens^=3^ delims^=^" %%B in ('type "%Temp%\BROW6.reg" ^| find "@"') do (
set "default=%%B"
set "default=!default:\\=\!"
set "default=!default:~0,-1!"
for %%D in ("!default!") do echo %%~nD
)
endLocal
del /Q /F "%Temp%\BROW6.reg"
echo.
echo.
pause