Created
November 23, 2018 08:45
-
-
Save OpossumPetya/c3a44575c7f9e6ded27a09df16550136 to your computer and use it in GitHub Desktop.
Start IE browser maximized (can be used with automation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo OFF | |
setlocal ENABLEEXTENSIONS | |
set IE11Maximized=2C0000000200000003 | |
set KEY_NAME="HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" | |
set VALUE_NAME=Window_Placement | |
:: REG QUERY "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v Window_Placement | |
for /f "usebackq tokens=3" %%A in (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) do ( | |
set ValueOrig=%%A | |
) | |
if not defined ValueOrig goto end | |
set ValueFirstPart=%ValueOrig:~0,18% | |
set ValueSecondPart=%ValueOrig:~18% | |
set ValueFinal=%IE11Maximized%%ValueSecondPart% | |
@echo Original value = %ValueOrig% | |
@echo Value to replace = %ValueFirstPart% | |
@echo Value to keep = %ValueSecondPart% | |
@echo Final value to write = %ValueFinal% | |
:: REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" /v Window_Placement /t REG_BINARY /d 2C0000000200000003000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1000000190000007B07000078030000 /f | |
REG ADD %KEY_NAME% /v %VALUE_NAME% /t REG_BINARY /d %ValueFinal% /f | |
:end: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This can be used with automation tasks.
It must be executed while IE browser is not running, otherwise the registry value will be overwritten when IE window is closed.