Created
July 1, 2022 04:46
-
-
Save maciakl/686a1f9b6bcc1d7d33b88320c2a1e094 to your computer and use it in GitHub Desktop.
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 | |
if "%1" == "elevated" goto start | |
powershell -command "Start-Process %~nx0 elevated -Verb runas" | |
goto :eof | |
:start | |
@echo off | |
cls | |
echo. | |
echo. | |
echo StorageSense Helper | |
echo =================== | |
echo. | |
CALL :CHECK | |
echo. | |
choice /M "Enable, Disable, or Quit" /C EDQ | |
if %ERRORLEVEL% == 1 ( CALL :ENABLE ) | |
if %ERRORLEVEL% == 2 ( CALL :DISABLE ) | |
if %ERRORLEVEL% == 3 ( goto :eof ) | |
goto :start | |
:DISABLE | |
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\StorageSense" /v AllowStorageSenseGlobal /t REG_DWORD /d 0 /f | |
echo. | |
goto :eof | |
:ENABLE | |
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\StorageSense" /v AllowStorageSenseGlobal /t REG_DWORD /d 1 /f | |
echo. | |
goto :eof | |
:CHECK | |
echo. | |
reg query "HKLM\SOFTWARE\Policies\Microsoft\Windows\StorageSense" /v AllowStorageSenseGlobal | |
echo. | |
goto :eof |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment