Skip to content

Commit

Permalink
feat: Removed non-HKCU from newUsers modules
Browse files Browse the repository at this point in the history
  • Loading branch information
TheyCreeper committed Feb 24, 2025
1 parent 2aebbe4 commit 5b57ce9
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 721 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Add newUsers.ps1 script
title: Add newUsers.cmd script
description: Adds the newUsers.ps1 script to RunOnce, which applies any tweaks that are dynamically generated on new user creation
actions:
- !registryValue:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ function Set-DisabledScheduledTasks {
Disable-ScheduledTask -TaskPath "\Microsoft\Windows\Application Experience\" -TaskName "PcaPatchDbTask"
Disable-ScheduledTask -TaskPath "\Microsoft\Windows\AppxDeploymentClient\" -TaskName "UCPD velocity" -ErrorAction SilentlyContinue
Disable-ScheduledTask -TaskPath "\Microsoft\Windows\Flighting\FeatureConfig\" -TaskName "UsageDataReporting" -ErrorAction SilentlyContinue
reg delete "HKLM\System\CurrentControlSet\Control\Ubpm" /v "CriticalMaintenance_UsageDataReporting" /f
}

function Invoke-AllDebloatOptimizations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,7 @@ function Add-MusicVideosToHome {
}
}

# Configure OEM Information (AtlasOS branding)
function Set-OEMInformation {
$version = "AtlasVersionUndefined"
$reportedVer = "Atlas Playbook $version"

bcdedit /set description "AtlasOS $(('10', '11')[[int]([System.Environment]::OSVersion.Version.Build -ge 22000)]) $version"

Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation' -Name 'Model' -Value $reportedVer -Force
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name 'RegisteredOrganization' -Value $reportedVer -Force
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation' -Name 'Manufacturer' -Value "Atlas Team" -Force
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation' -Name 'SupportURL' -Value "https://discord.atlasos.net" -Force
Set-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation' -Name 'SupportPhone' -Value "https://github.com/Atlas-OS/Atlas" -Force
}

# Configure Time Servers for better accuracy
function Set-TimeServers {
Expand All @@ -35,26 +23,6 @@ function Set-TimeServers {
w32tm /resync
}

# Delete Windows-version specific tweaks
function Remove-VersionSpecificTweaks {
if ([System.Environment]::OSVersion.Version.Build -ge 22000) {
Remove-Item -Path "$env:windir\AtlasDesktop\4. Interface Tweaks\File Explorer Customization\Folders in This PC" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:windir\AtlasDesktop\4. Interface Tweaks\File Explorer Customization\Quick Access" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:windir\AtlasDesktop\4. Interface Tweaks\Old Flyouts" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:windir\AtlasDesktop\4. Interface Tweaks\Alt-Tab" -Force -ErrorAction SilentlyContinue
} else {
Remove-Item -Path "$env:windir\AtlasDesktop\3. General Configuration\Background Apps" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:windir\AtlasModules\Tools\TimerResolution.exe" -Force -ErrorAction SilentlyContinue
}
}

# Make MeasureSleep.exe run as admin
function Enable-MeasureSleepAdmin {
Set-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers' `
-Name "$([Environment]::GetFolderPath('Windows'))\AtlasDesktop\3. General Configuration\Timer Resolution\! MeasureSleep.exe" `
-Value '~ RUNASADMIN' -Force
}

# Rebuild Performance Counters
function Reset-PerformanceCounters {
lodctr /r
Expand All @@ -65,14 +33,8 @@ function Reset-PerformanceCounters {
function Invoke-AllMiscSystemUtilities {
Write-Host "Add-MusicVideosToHome"
Add-MusicVideosToHome
Write-Host "Set oem information"
Set-OEMInformation
Write-Host "set time servers"
Set-TimeServers
Write-Host "removing version specific tweaks"
Remove-VersionSpecificTweaks
Write-Host "enable measure sleep admin"
Enable-MeasureSleepAdmin
Write-Host "Resetting performance counter"
Reset-PerformanceCounters
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,45 +1,9 @@
# Disables paging settings for improved performanc
function Disable-PagingSettings {
$key = "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management"
reg add $key /v "DisablePagingExecutive" /t REG_DWORD /d 1 /f
reg add $key /v "DisablePageCombining" /t REG_DWORD /d 1 /f
}

# Disables Service Host splitting (except Xbox services) to reduce RAM usage
function Disable-ServiceHostSplitting {
Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Services' |
Where-Object { $_.Name -notmatch 'Xbl|Xbox' } |
ForEach-Object {
if ($null -ne (Get-ItemProperty -Path "Registry::$_" -ErrorAction SilentlyContinue).Start) {
Set-ItemProperty -Path "Registry::$_" -Name 'SvcHostSplitDisable' -Type DWORD -Value 1 -Force -ErrorAction SilentlyContinue
}
}
}

# Optimizes NTFS for performance
function Optimize-NTFS {
fsutil behavior set disablelastaccess 1
fsutil behavior set disable8dot3 1
}

# Prioritizes foreground applications for process scheduling
function Optimize-ForegroundApps {
$key = "HKLM\SYSTEM\CurrentControlSet\Control\PriorityControl"
reg add $key /v "Win32PrioritySeparation" /t REG_DWORD /d 38 /f
}

# Sets Automatic Maintenance settings
function Set-AutomaticMaintenance {
$key = "HKLM\SOFTWARE\Policies\Microsoft\Windows\Task Scheduler\Maintenance"
reg add $key /v "WakeUp" /t REG_DWORD /d 0 /f
}

# Sets Multimedia Class Scheduler Service for performance
function Set-MMCSS {
$key = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile"
reg add $key /v "SystemResponsiveness" /t REG_DWORD /d 10 /f
}

# Disables Automatic Folder Discovery to improve File Explorer performance
function Disable-AutoFolderDiscovery {
& "$windir\AtlasDesktop\4. Interface Tweaks\File Explorer Customization\Automatic Folder Discovery\Disable Automatic Folder Discovery (default).cmd" /justcontext
Expand All @@ -54,16 +18,6 @@ function Disable-BackgroundApps {
reg add $key2 /v "BackgroundAppGlobalToggle" /t REG_DWORD /d 0 /f
}

# Disables Fault Tolerant Heap (FTH) to avoid performance penalties
function Disable-FTH {
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
Remove-Item -Path "$env:windir\AtlasDesktop\7. Security\Mitigations\Fault Tolerant Heap" -Recurse -Force -ErrorAction SilentlyContinue
} elseif ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") {
Start-Process -FilePath "rundll32.exe" -ArgumentList "fthsvc.dll,FthSysprepSpecialize" -NoNewWindow -Wait
reg add "HKLM\SOFTWARE\Microsoft\FTH" /v "Enabled" /t REG_DWORD /d 0 /f
}
}

# Disables Xbox Game Bar and related settings
function Disable-GameBar {
$keys = @(
Expand Down Expand Up @@ -99,39 +53,18 @@ function Disable-SleepStudy {
schtasks /Change /TN "\Microsoft\Windows\Power Efficiency Diagnostics\AnalyzeSystem" /Disable
}

# Respects power modes for Windows Search indexing to prevent battery drain
function Set-SearchIndexingPowerMode {
$key = "HKLM\Software\Microsoft\Windows Search\Gather\Windows\SystemIndex"
reg add $key /v "RespectPowerModes" /t REG_DWORD /d 1 /f
}

# Executes all optimizations in sequence
function Invoke-AllPerformanceOptimizations {
Write-Host "Running performance optimisations"
Write-Host "disable paging settings"
Disable-PagingSettings
Write-Host "disabling service host splitting"
Disable-ServiceHostSplitting
Write-Host "Optimizing NTFS"
Optimize-NTFS
Write-Host "Optimizing Foreground Apps"
Optimize-ForegroundApps
Write-Host "set automatic maintenance"
Set-AutomaticMaintenance
Write-Host "setting mmcss"
Set-MMCSS
Write-Host "disabling auto folder discovery"
Disable-AutoFolderDiscovery
Write-Host "disabling background apps"
Disable-BackgroundApps
Write-Host "disabling fth"
Disable-FTH
Write-Host "disabling game bar"
Disable-GameBar
Write-Host "disabling sleep study"
Disable-SleepStudy
Write-Host "setting search indexing power mode"
Set-SearchIndexingPowerMode
}

Export-ModuleMember -Function Invoke-AllPerformanceOptimizations
Loading

0 comments on commit 5b57ce9

Please sign in to comment.