Skip to content

Commit

Permalink
Merge pull request #1354 from RadNotRed/script-overhaul
Browse files Browse the repository at this point in the history
Script overhaul
  • Loading branch information
RadNotRed authored Feb 19, 2025
2 parents f914827 + d901bc0 commit efad541
Show file tree
Hide file tree
Showing 255 changed files with 6,081 additions and 1,154 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
.DS_Store

# Playbooks
*.apbx
*.apbx
*.apbx.tmp
src/playbook/pester-tests
src/dependencies/local-build.ps1
8 changes: 8 additions & 0 deletions src/playbook/Configuration/atlas/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Defaults
description: Run default AtlasFolder scripts
actions:
- !writeStatus: {status: 'Applying default Atlas Folder settings'}
- !powerShell:
command: '.\DEFAULT.ps1'
wait: true
2 changes: 2 additions & 0 deletions src/playbook/Configuration/atlas/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ actions:
command: '"AtlasDesktop\3. General Configuration\Location\Disable Location (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated

- !writeStatus: {status: 'Configuring Indexing'}
- !cmd:
command: '"AtlasDesktop\3. General Configuration\Search Indexing\Minimal Search Indexing (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated

##############################################################################################
## SERVICES ##
Expand Down
1 change: 1 addition & 0 deletions src/playbook/Configuration/custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ actions:
- !task: {path: 'atlas\services.yml'}
- !task: {path: 'atlas\components.yml'}
- !task: {path: 'atlas\appx.yml'}
- !task: {path: 'atlas\default.yml'}
- !task: {path: 'tweaks.yml'}
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,21 @@ title: Disable Scheduled Tasks
description: Disables scheduled tasks to prevent automatic tasks from running at startup, consuming resources and collecting user data
actions:
# Updates compatibility database
- !scheduledTask: {path: '\Microsoft\Windows\Application Experience\PcaPatchDbTask', operation: disable}
- !scheduledTask: {path: '\Microsoft\Windows\Application Experience\PcaPatchDbTask', operation: disable, ignoreErrors: true}

# UCPD - might not exist on all installs, so ignore errors
- !scheduledTask: {path: '\Microsoft\Windows\AppxDeploymentClient\UCPD velocity', operation: disable, ignoreErrors: true}

# Data collection
- !scheduledTask: {path: '\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector', operation: disable, ignoreErrors: true}

# CEIP - safety measure
- !scheduledTask: {path: '\Microsoft\Windows\Customer Experience Improvement Program\Consolidator', operation: disable, ignoreErrors: true}
- !scheduledTask: {path: '\Microsoft\Windows\Customer Experience Improvement Program\UsbCeip', operation: disable, ignoreErrors: true}

# A/B testing usage reports
- !scheduledTask: {path: '\Microsoft\Windows\Flighting\FeatureConfig\UsageDataReporting', operation: disable, ignoreErrors: true}
- !registryValue:
path: 'HKLM\System\CurrentControlSet\Control\Ubpm'
value: 'CriticalMaintenance_UsageDataReporting' # Remove from automatic maintenance
operation: delete

# -------------------------------------------------------------------------------------
# Here are the scheduled tasks that are currently commented as they're under review.
# This list should be somewhat minimal in the tasks it deletes, as a lot of the tasks
# below won't run by default ever anyways, unless needed.
# Telemetry and CEIP/SQM is stripped by default anyways, so don't worry about that.
# -------------------------------------------------------------------------------------

# - !scheduledTask:
# path: '\Microsoft\Windows\DeviceDirectoryClient'
# operation: deleteFolder

# Needed for Windows Update to function properly
# - !scheduledTask: {path: '\Microsoft\Windows\InstallService\ScanForUpdates'}
# - !scheduledTask: {path: '\Microsoft\Windows\InstallService\ScanForUpdatesAsUser'}
# - !scheduledTask: {path: '\Microsoft\Windows\WindowsUpdate\Scheduled Start'}

# "The Windows Scheduled Maintenance Task performs periodic maintenance of the
# computer system by fixing problems automatically or reporting them through Security and Maintenance."
# - !scheduledTask: {path: '\Microsoft\Windows\Diagnosis\Scheduled', operation: disable}

# Wouldn't be randomly executed
# - !scheduledTask: {path: '\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector'}
# - !scheduledTask: {path: '\Microsoft\Windows\DiskFootprint\Diagnostics'}
# - !scheduledTask: {path: '\Microsoft\Windows\Maintenance\WinSAT'}
# - !scheduledTask: {path: '\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic'}
# - !scheduledTask: {path: '\Microsoft\Windows\Shell\IndexerAutomaticMaintenance'} # Unless indexing is enabled
# - !scheduledTask: {path: '\Microsoft\Windows\Shell\FamilySafetyMonitor'}
# - !scheduledTask: {path: '\Microsoft\Windows\Shell\FamilySafetyRefresh'}
# - !scheduledTask: {path: '\Microsoft\Windows\PI\Sqm-Tasks'}
# - !scheduledTask: {path: '\Microsoft\Windows\Registry\RegIdleBackup'} # Registry backups are disabled by default
# - !scheduledTask: {path: '\Microsoft\Windows\StateRepository\MaintenanceTasks'}
# - !scheduledTask: {path: '\Microsoft\Windows\ApplicationData\appuriverifierdaily'}
# - !scheduledTask:
# path: '\Microsoft\Windows\Location'
# operation: deleteFolder

# Needs research
# - !scheduledTask: {path: '\Microsoft\Windows\AppID\EDP Policy Manager'}
# - !scheduledTask: {path: '\Microsoft\Windows\ApplicationData\appuriverifierinstall'}
# - !scheduledTask: {path: '\Microsoft\Windows\BrokerInfrastructure\BgTaskRegistrationMaintenanceTask'}
# - !scheduledTask: {path: '\Microsoft\Windows\Defrag\ScheduledDefrag'}
# - !scheduledTask: {path: '\Microsoft\Windows\Device Setup\Metadata Refresh'}
# - !scheduledTask: {path: '\Microsoft\Windows\InstallService\SmartRetry'}
# - !scheduledTask: {path: '\Microsoft\Windows\Management\Provisioning\Cellular'}
# - !scheduledTask: {path: '\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents'}
# - !scheduledTask: {path: '\Microsoft\Windows\Printing\EduPrintProv'}
# - !scheduledTask: {path: '\Microsoft\Windows\PushToInstall\LoginCheck'}
# - !scheduledTask: {path: '\Microsoft\Windows\Ras\MobilityManager'}
# - !scheduledTask: {path: '\Microsoft\Windows\UPnP\UPnPHostConfig'}
# - !scheduledTask: {path: '\Microsoft\Windows\WaaSMedic\PerformRemediation'}
# - !scheduledTask: {path: '\Microsoft\Windows\Windows Media Sharing\UpdateLibrary'}
# - !scheduledTask: {path: '\Microsoft\Windows\CloudExperienceHost\CreateObjectTask'}
# - !scheduledTask: {path: '\Microsoft\Windows\ApplicationData\DsSvcCleanup'}
# - !scheduledTask: {path: '\Microsoft\Windows\Application Experience\StartupAppTask'} # notification to the user if there are too many startup entries
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ actions:
path: 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce'
value: 'RunScript'
data: |
powershell -EP Bypass -NoP & """$([Environment]::GetFolderPath('Windows'))\AtlasModules\Scripts\newUsers.ps1"""
powershell -EP Bypass -NoP & """$([Environment]::GetFolderPath('Windows'))\AtlasModules\Scripts\newUsers.cmd"""
type: REG_SZ
scope: defaultUser
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ actions:
command: '"AtlasDesktop\8. Troubleshooting\Network\Reset Network to Atlas Default.cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ actions:
# data: 'NotSpecified'
# type: REG_SZ
- !cmd:
command: 'reg import "AtlasDesktop\4. Interface Tweaks\File Explorer Customization\Automatic Folder Discovery\Disable Automatic Folder Discovery (default).reg"'
command: '"AtlasDesktop\4. Interface Tweaks\File Explorer Customization\Automatic Folder Discovery\Disable Automatic Folder Discovery (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Disables snapshots of Recall (24H2+)
builds: [ '>=22000' ]
actions:
- !cmd:
command: 'reg import "AtlasDesktop\3. General Configuration\AI Features\Recall\Disable Recall Support (default).reg"'
command: '"AtlasDesktop\3. General Configuration\AI Features\Recall\Disable Recall Support (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Disable Automatic Store App Archiving
description: Disables automatic Store app archiving so that less commonly apps don't disappear and have to be redownloaded
actions:
- !cmd:
command: 'reg import "AtlasDesktop\3. General Configuration\Store App Archiving\Disable Store App Archiving (default).reg"'
command: '"AtlasDesktop\3. General Configuration\Store App Archiving\Disable Store App Archiving (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ actions:
"AtlasDesktop\4. Interface Tweaks\Context Menus\Send To\Debloat Send To Context Menu.cmd" -Disable @('Documents', 'Mail Recipient', 'Fax recipient', 'Bluetooth')
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ actions:
# data: '0'
# type: REG_DWORD
- !cmd:
command: 'reg import "AtlasDesktop\4. Interface Tweaks\File Explorer Customization\Gallery\Disable Gallery (default).reg"'
command: '"AtlasDesktop\4. Interface Tweaks\File Explorer Customization\Gallery\Disable Gallery (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ actions:
# data: '0'
# type: REG_DWORD
- !cmd:
command: 'reg import "AtlasDesktop\3. General Configuration\File Sharing\Network Navigation Pane\Disable Network Navigation Pane (default).reg"'
command: '"AtlasDesktop\3. General Configuration\File Sharing\Network Navigation Pane\Disable Network Navigation Pane (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Remove 'Extract' from Context Menu
description: Removes 'Extract' from Context Menu
actions:
- !cmd:
command: 'reg import "AtlasDesktop\4. Interface Tweaks\Context Menus\Extract\Remove Extract (default).reg"'
command: '"AtlasDesktop\4. Interface Tweaks\Context Menus\Extract\Remove Extract (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ actions:
command: '"AtlasDesktop\6. Advanced Configuration\Services\Printing\Disable Printing.cmd" /justcontext'
exeDir: true
wait: true
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ actions:
# data: ''
# type: REG_SZ
- !cmd:
command: 'reg import "AtlasDesktop\4. Interface Tweaks\Context Menus\Windows 11\Old Context Menu (default).reg"'
command: '"AtlasDesktop\4. Interface Tweaks\Context Menus\Windows 11\Old Context Menu (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
runas: currentUserElevated
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ description: Disables Windows Update from automatically updating Windows for QoL
actions:
# Disable auto-updates
- !cmd:
command: 'reg import "AtlasDesktop\3. General Configuration\Automatic Updates\Disable Automatic Updates (default).reg"'
command: '"AtlasDesktop\3. General Configuration\Automatic Updates\Disable Automatic Updates (default).cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
option: 'auto-updates-disable'

# Prevent DevHome & Outlook from re-installing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ actions:
command: '"AtlasDesktop\7. Security\Mitigations\Disable All Mitigations.cmd" /silent'
exeDir: true
wait: true
runas: currentUserElevated
4 changes: 3 additions & 1 deletion src/playbook/Configuration/tweaks/scripts/script-power.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ description: Executes script to configure power settings for the best performanc
actions:
# Disable power saving features
- !cmd:
command: '"AtlasDesktop\3. General Configuration\Power-saving\Disable Power-saving.cmd" -Silent'
command: '"AtlasDesktop\3. General Configuration\Power-saving\Disable Power-saving.cmd" /silent'
exeDir: true
wait: true
weight: 20
runas: currentUserElevated
option: 'disable-power-saving'

# Disable Fast Startup
Expand All @@ -24,6 +25,7 @@ actions:
exeDir: true
wait: true
weight: 20
runas: currentUserElevated
option: 'disable-hibernation'

# Set 'Balanced' power scheme if keeping power saving
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
@echo off
set "settingName=Copilot"
set "stateValue=0"
set "scriptPath=%~f0"

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 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
)

reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul


echo Disabling and uninstalling Copilot...

powershell -NoP -NonI "Get-AppxPackage -AllUsers Microsoft.Copilot* | Remove-AppxPackage -AllUsers"
Expand All @@ -19,6 +26,8 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "S
reg add "HKCU\Software\Policies\Microsoft\Windows\WindowsCopilot" /v "TurnOffWindowsCopilot" /t REG_DWORD /d "1" /f > nul
start explorer.exe

if "%~1"=="/silent" exit /b

echo]
echo Finished, changes are applied.
echo Press any key to exit...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
@echo off
set "settingName=Copilot"
set "stateValue=1"
set "scriptPath=%~f0"

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 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
)

reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul


:: Check for Edge support
echo]
call "%windir%\AtlasModules\Scripts\edgeCheck.cmd" /edgeonly
Expand All @@ -28,6 +35,7 @@ if %errorlevel%==0 (call :app) else (reg add "HKCU\Software\Microsoft\Windows\Cu
taskkill /f /im explorer.exe > nul 2>&1
reg delete "HKCU\Software\Policies\Microsoft\Windows\WindowsCopilot" /v "TurnOffWindowsCopilot" /f > nul 2>&1
start explorer.exe
if "%~1"=="/silent" exit /b

:finish
echo]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off
set "settingName=Recall"
set "stateValue=0"
set "scriptPath=%~f0"

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
)

reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" /v "DisableAIDataAnalysis" /t REG_DWORD /d 1 /f > nul
if "%~1"=="/silent" exit /b

echo.
echo Recall has been disabled.
echo Press any key to exit...
pause > nul
exit /b

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off
set "settingName=Recall"
set "stateValue=1"
set "scriptPath=%~f0"

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
)

reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v state /t REG_DWORD /d %stateValue% /f > nul
reg add "HKLM\SOFTWARE\AtlasOS\%settingName%" /v path /t REG_SZ /d "%scriptPath%" /f > nul

reg delete "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsAI" /v "DisableAIDataAnalysis" /f > nul 2>&1
if "%~1"=="/silent" exit /b

echo.
echo Recall has been enabled.
echo Press any key to exit...
pause > nul
exit /b

This file was deleted.

Loading

0 comments on commit efad541

Please sign in to comment.