Last active
October 14, 2019 13:25
-
-
Save zhou9110/86581778b0a11c7dfce336a8bd529dc8 to your computer and use it in GitHub Desktop.
Turn on/off auto-hiding taskbar in tablet mode automatically for Windows 10
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
:: Switch the auto-hide taskbar in tablet mode on and off | |
:: by overwriting registery via batch script | |
:: Modified by: zhou9110 | |
:: Modified on: October 14th 2019 | |
:: | |
:: Reference: | |
:: Originally Created by: Shawn Brink | |
:: Originally Created on: April 22nd 2016 | |
:: Tutorial: | |
:: http://www.tenforums.com/tutorials/48127-taskbar-auto-hide-tablet-mode-turn-off-windows-10-a.html | |
:: Original File: | |
:: https://www.tenforums.com/attachments/tutorials/76240d1461384444-taskbar-auto-hide-tablet-mode-turn-off-windows-10-a-turn_on_auto-hide_taskbar_in_tablet_mode.bat | |
:: https://www.tenforums.com/attachments/tutorials/76239d1461384444-taskbar-auto-hide-tablet-mode-turn-off-windows-10-a-turn_off_auto-hide_taskbar_in_tablet_mode.bat | |
@echo off | |
REM Configs | |
SET REGKEY=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced | |
SET REGVAL=TaskbarAutoHideInTabletMode | |
SET DISPLAY_TEXT_ENABLED=Enabled auto-hide in tablet mode | |
SET DISPLAY_TEXT_DISABLED=Disabled auto-hide in tablet mode | |
SET TIMEOUT_SECOND=2 | |
REM Query the value in registery | |
SET TASKBAR_AUTO_HIDE_ENABLED= | |
FOR /F "tokens=2,*" %%A IN ('REG Query %REGKEY% /V %REGVAL% ^|findstr %REGVAL%') DO ( | |
SET TASKBAR_AUTO_HIDE_ENABLED=%%B | |
) | |
REM Checking if the value is set | |
IF not defined TASKBAR_AUTO_HIDE_ENABLED ( | |
SET TASKBAR_AUTO_HIDE_ENABLED=0 | |
) | |
IF %TASKBAR_AUTO_HIDE_ENABLED% EQU 0 ( | |
REM Enable Auto-hide in tablet mode | |
REG ADD %REGKEY% /V %REGVAL% /T REG_DWORD /D 1 /F >NUL | |
ECHO %DISPLAY_TEXT_ENABLED% | |
) ELSE ( | |
REM Disable Auto-hide in tablet mode | |
REG ADD %REGKEY% /V %REGVAL% /T REG_DWORD /D 0 /F >NUL | |
ECHO %DISPLAY_TEXT_DISABLED% | |
) | |
TIMEOUT %TIMEOUT_SECOND% >NUL | |
REM To kill and restart explorer to take effects | |
TASKKILL /f /im explorer.exe | |
START explorer.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use
Download the Raw file to a local directory.
Then double click the script file to run the script.
How to add it to the Start screen?
Caution
Beware that the
explorer.exe
has to be restarted to take effect. Any opened File Explorer window will be closed after the running the script.