Skip to content

Commit

Permalink
feat(interface tweaks): recent items scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
he3als committed Mar 31, 2024
1 parent 48db55c commit d74d36f
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 14 deletions.
34 changes: 20 additions & 14 deletions src/playbook/Configuration/tweaks/qol/config-start-menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,38 @@ actions:
type: REG_SZ
data: '{"pinnedList":[{"packagedAppId":"windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel"},{"packagedAppId":"Microsoft.WindowsTerminal_8wekyb3d8bbwe!App"},{"desktopAppLink":"%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\File Explorer.lnk"},{"packagedAppId":"Microsoft.WindowsStore_8wekyb3d8bbwe!App"},{"packagedAppId":"Microsoft.GamingApp_8wekyb3d8bbwe!Microsoft.Xbox.App"},{"packagedAppId":"Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"},{"packagedAppId":"Microsoft.WindowsNotepad_8wekyb3d8bbwe!App"},{"packagedAppId":"Microsoft.Paint_8wekyb3d8bbwe!App"},{"packagedAppId":"Microsoft.SecHealthUI_8wekyb3d8bbwe!SecHealthUI"}]}'

# Configure start menu settings
# Set Windows 10 & 11 start menu pins
- !taskKill: {name: 'StartMenuExperienceHost', ignoreErrors: true}
- !run:
exeDir: true
exe: 'STARTMENU.cmd'
weight: 20
- !appx: {operation: clearCache, name: 'Microsoft.Windows.StartMenuExperienceHost*'}

# Remove frequent programs list from the Start Menu
- !registryValue:
path: 'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer'
value: 'NoStartMenuMFUprogramsList'
data: '1'
type: REG_DWORD
# Hide "Most used" list from Start menu
- !registryValue:
path: 'HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer'
value: 'HideRecentlyAddedApps'
data: '1'
value: 'ShowOrHideMostUsedApps'
data: '2'
type: REG_DWORD

# Remove "Recently added" list from Start Menu
- !registryValue:
path: 'HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer'
value: 'HideRecommendedPersonalizedSites'
value: 'HideRecentlyAddedApps'
data: '1'
type: REG_DWORD

# Remove Personalized Website Recommendations from the Recommended section in the Start Menu
# https://www.elevenforum.com/t/add-or-remove-recommended-websites-on-start-menu-in-windows-11.10667/
- !registryValue:
path: 'HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer'
value: 'ShowOrHideMostUsedApps'
data: '2'
value: 'HideRecommendedPersonalizedSites'
data: '1'
type: REG_DWORD

# Set Windows 10 & 11 start menu pins
- !taskKill: {name: 'StartMenuExperienceHost', ignoreErrors: true}
- !run:
exeDir: true
exe: 'STARTMENU.cmd'
weight: 20
- !appx: {operation: clearCache, name: 'Microsoft.Windows.StartMenuExperienceHost*'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@echo off

set "___args="%~f0" %*"
fltmc > nul 2>&1 || (
echo Administrator privileges are required.
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || (
echo You must run this script as admin.
if "%*"=="" pause
exit /b 1
)
exit /b
)

echo Disabling recent items...

(
rem Policy
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /t REG_DWORD /d "1" /f
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ClearRecentDocsOnExit" /t REG_DWORD /d "1" /f
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoRecentDocsHistory" /t REG_DWORD /d "1" /f
reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoRemoteDestinations" /t REG_DWORD /d "1" /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /t REG_DWORD /d "1" /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoRecentDocsHistory" /t REG_DWORD /d "1" /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /t REG_DWORD /d "1" /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "HideRecentlyAddedApps" /t REG_DWORD /d "1" /f

rem Non-policy
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackProgs" /t REG_DWORD /d "0" /f
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackDocs" /t REG_DWORD /d "0" /f
) > nul

(
taskkill /f /im SettingsApp.exe
taskkill /f /im explorer.exe
start explorer.exe
) > nul 2>&1

call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /hide privacy-general

echo]
echo Finished, features relating to app, document, etc tracking have been disabled.
echo Press any key to exit...
pause > nul
exit /b
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
@echo off

set "___args="%~f0" %*"
fltmc > nul 2>&1 || (
echo Administrator privileges are required.
powershell -c "Start-Process -Verb RunAs -FilePath 'cmd' -ArgumentList """/c $env:___args"""" 2> nul || (
echo You must run this script as admin.
if "%*"=="" pause
exit /b 1
)
exit /b
)

echo Unlocking recent items...

(
rem Policy
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInstrumentation" /f
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ClearRecentDocsOnExit" /f
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoRecentDocsHistory" /f
reg delete "HKCU\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoRemoteDestinations" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoStartMenuMFUprogramsList" /f
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoRecentDocsHistory" /f
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "ShowOrHideMostUsedApps" /f
reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "HideRecentlyAddedApps" /f

rem Non-policy
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackProgs" /t REG_DWORD /d "1" /f
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackDocs" /t REG_DWORD /d "1" /f

taskkill /f /im SettingsApp.exe
taskkill /f /im explorer.exe
start explorer.exe
) > nul 2>&1

call "%windir%\AtlasModules\Scripts\settingsPages.cmd" /unhide privacy-general

echo]
echo Finished, you should be able to configure features relating to app, document, etc tracking.
echo See File Explorer's options panel, as well as the Start and general privacy settings pages.
echo Press any key to exit...
pause > nul
exit /b

0 comments on commit d74d36f

Please sign in to comment.