@echo off
TITLE Revert Unpin/Hide 'Store' icon from the TaskBar.
COLOR 1F
mode con cols=95 lines=10
echo.

cd %systemroot%\system32
call :IsAdmin
CLS
TITLE Revert Unpin/Hide 'Store' icon from the TaskBar.
cls
color 1f
echo.
for /f "tokens=4-5 delims=. " %%i in ('ver') do set "TestWinVer=%%i.%%j"
IF "%TestWinVer%"=="6.1" SET "Is810=0"
IF "%TestWinVer%"=="6.0" SET "Is810=0"
IF NOT DEFINED Is810 GOTO :Win810
echo This script only works on Windows 8.0+ Kernels.
echo.
pause
exit

:Win810
echo.
echo Simple script to revert the Unpin/Hide 'Store' icon and UWP Apps registry 
echo entries to allow pinning etc on the TaskBar again.
echo.
echo Press any key to revert or CTRL-C to terminate/exit the script...
echo.
pause

REG DELETE "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "NoPinningStoreToTaskbar" /f >nul 2>&1
REG DELETE "HKLM\Software\Policies\Microsoft\Windows\Explorer" /v "NoPinningStoreToTaskbar" /f >nul 2>&1

REG DELETE "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "StoreAppsOnTaskbar" /f >nul 2>&1
REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "StoreAppsOnTaskbar" /f >nul 2>&1

echo.
echo Done. 
echo.
echo Note: Sign/Log out will be required to allow re-pinning of the Store icon 
echo       and UWP Apps again.

:Finished
TIMEOUT /T 5 >NUL 2>&1
exit

:IsAdmin
Reg.exe query "HKU\S-1-5-19\Environment"
If Not %ERRORLEVEL% EQU 0 (
 Cls
 echo.
 Echo You must have administrator rights to continue...
 echo.
 Pause
 Exit
)
