Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #########################################################################################################
- #Read all about the tweaks here on Melodys page: https://sites.google.com/view/melodystweaks/basictweaks#
- #########################################################################################################
- # in 2.0 you can actually overwrite current values! Amazing i know..smh :D
- function Set-RegistryValue {
- param (
- [string]$path,
- [string]$name,
- $value,
- [string]$type = "DWord",
- [switch]$Force
- )
- # Check if the key exists and create it if it doesn't
- $key = Get-Item -Path $path -ErrorAction SilentlyContinue
- if ($null -eq $key) {
- try {
- New-Item -Path $path -Force | Out-Null
- $key = Get-Item -Path $path
- Write-Host "Creating key at $path." -ForegroundColor Green
- }
- catch {
- Write-Warning "Failed to create key $key. $_"
- }
- }
- else {
- Write-Host "Key at $path already exists."
- }
- # Set the value, overwriting if it exists when -Force is specified
- try {
- if ($Force -or ($key.GetValue($name, "NotExist") -eq "NotExist")) {
- Set-ItemProperty -Path $path -Name $name -Value $value -Type $type -Force | Out-Null
- Write-Host "Setting $type value $name to $value." -ForegroundColor Green
- }
- else {
- Write-Host "$type value $name with existing value already exists. Use -Force to overwrite." -ForegroundColor Yellow
- }
- }
- catch {
- Write-Warning "Failed to set value $name at $path. $_"
- }
- }
- # Registry settings
- $registryValues = @{
- "HKLM:\SOFTWARE\Policies\Microsoft\FVE" = @{
- "DisableExternalDMAUnderLock" = @{ Value = 0; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard" = @{
- "EnableVirtualizationBasedSecurity" = @{ Value = 0; Type = "DWord" }
- "HVCIMATRequired" = @{ Value = 0; Type = "DWord" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" = @{
- "DisableExceptionChainValidation" = @{ Value = 1; Type = "DWord" }
- "KernelSEHOPEnabled" = @{ Value = 0; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\csrss.exe\PerfOptions" = @{
- "CpuPriorityClass" = @{ Value = 4; Type = "DWord" }
- "IoPriority" = @{ Value = 3; Type = "DWord" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" = @{
- "FeatureSettings" = @{ Value = 1; Type = "DWord" }
- "FeatureSettingsOverride" = @{ Value = 3; Type = "DWord" }
- "FeatureSettingsOverrideMask" = @{ Value = 3; Type = "DWord" }
- "EnableCfg" = @{ Value = 0; Type = "DWord" }
- "DisablePagingExecutive" = @{ Value = 1; Type = "DWord" }
- "LargeSystemCache" = @{ Value = 1; Type = "DWord" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" = @{
- "ProtectionMode" = @{ Value = 0; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Reliability" = @{
- "TimeStampInterval" = @{ Value = 1; Type = "DWord" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" = @{
- "DpiMapIommuContiguous" = @{ Value = 1; Type = "DWord" }
- }
- #####################################################################
- #NVIDIA VALUES - CHANGE TO AMD VALUES DOWN BELOW YOU HAVE A AMD CARD#
- #####################################################################
- "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0000" = @{
- "PreferSystemMemoryContiguous" = @{ Value = 1; Type = "DWord" }
- "D3PCLatency" = @{ Value = 1; Type = "DWord" }
- "F1TransitionLatency" = @{ Value = 1; Type = "DWord" }
- "LOWLATENCY" = @{ Value = 1; Type = "DWord" }
- "Node3DLowLatency" = @{ Value = 1; Type = "DWord" }
- "PciLatencyTimerControl" = @{ Value = 32; Type = "DWord" }
- "RMDeepL1EntryLatencyUsec" = @{ Value = 1; Type = "DWord" }
- "RmGspcMaxFtuS" = @{ Value = 1; Type = "DWord" }
- "RmGspcMinFtuS" = @{ Value = 1; Type = "DWord" }
- "RmGspcPerioduS" = @{ Value = 1; Type = "DWord" }
- "RMLpwrEiIdleThresholdUs" = @{ Value = 1; Type = "DWord" }
- "RMLpwrGrIdleThresholdUs" = @{ Value = 1; Type = "DWord" }
- "RMLpwrGrRgIdleThresholdUs" = @{ Value = 1; Type = "DWord" }
- "RMLpwrMsIdleThresholdUs" = @{ Value = 1; Type = "DWord" }
- "VRDirectFlipDPCDelayUs" = @{ Value = 1; Type = "DWord" }
- "VRDirectFlipTimingMarginUs" = @{ Value = 1; Type = "DWord" }
- "VRDirectJITFlipMsHybridFlipDelayUs" = @{ Value = 1; Type = "DWord" }
- "vrrCursorMarginUs" = @{ Value = 1; Type = "DWord" }
- "vrrDeflickerMarginUs" = @{ Value = 1; Type = "DWord" }
- "vrrDeflickerMaxUs" = @{ Value = 1; Type = "DWord" }
- #"LTRSnoopL0Latency" = @{ Value = 1; Type = "DWord" }
- #"LTRNoSnoopL1Latency" = @{ Value = 1; Type = "DWord" }
- #"LTRMaxNoSnoopLatency" = @{ Value = 1; Type = "DWord" }
- #"KMD_RpmComputeLatency" = @{ Value = 1; Type = "DWord" }
- #"DalUrgentLatencyNs" = @{ Value = 1; Type = "DWord" }
- #"memClockSwitchLatency" = @{ Value = 1; Type = "DWord" }
- #"PP_RTPMComputeF1Latency" = @{ Value = 1; Type = "DWord" }
- #"PP_DGBMMMaxTransitionLatencyUvd" = @{ Value = 1; Type = "DWord" }
- #"PP_DGBPMMaxTransitionLatencyGfx" = @{ Value = 1; Type = "DWord" }
- #"DalNBLatencyForUnderFlow" = @{ Value = 1; Type = "DWord" }
- #"DalDramClockChangeLatencyNs" = @{ Value = 1; Type = "DWord" } #(WARNING: This dword caused massive screen flickering for some people, use it at your own risk. If you're already using it and you have problems, simply delete the dword and reboot the system)
- #"BGM_LTRSnoopL1Latency" = @{ Value = 1; Type = "DWord" }
- #"BGM_LTRSnoopL0Latency" = @{ Value = 1; Type = "DWord" }
- #"BGM_LTRNoSnoopL1Latency" = @{ Value = 1; Type = "DWord" }
- #"BGM_LTRNoSnoopL0Latency" = @{ Value = 1; Type = "DWord" }
- #"BGM_LTRMaxSnoopLatencyValue" = @{ Value = 1; Type = "DWord" }
- #"BGM_LTRMaxNoSnoopLatencyValue" = @{ Value = 1; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" = @{
- "AllowTelemetry" = @{ Value = 0; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Policies\Microsoft\Windows\AppCompat" = @{
- "AITEnable" = @{ Value = 0; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" = @{
- "Disabled" = @{ Value = 1; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Policies\Microsoft\Windows\QoS" = @{
- "Tcp Autotuning Level" = @{ Value = "Experimental"; Type = "String" }
- "Application DSCP Marking Request" = @{ Value = "Allowed"; Type = "String" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Services\mouclass\Parameters" = @{
- "MouseDataQueueSize" = @{ Value = 16; Type = "DWord" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Services\kbdclass\Parameters" = @{
- "KeyboardDataQueueSize" = @{ Value = 16; Type = "DWord" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Control\Power" = @{
- "ExitLatency" = @{ Value = 1; Type = "DWord" }
- "ExitLatencyCheckEnabled" = @{ Value = 1; Type = "DWord" }
- "Latency" = @{ Value = 1; Type = "DWord" }
- "LatencyToleranceDefault" = @{ Value = 1; Type = "DWord" }
- "LatencyToleranceFSVP" = @{ Value = 1; Type = "DWord" }
- "LatencyTolerancePerfOverride" = @{ Value = 1; Type = "DWord" }
- "LatencyToleranceScreenOffIR" = @{ Value = 1; Type = "DWord" }
- "LatencyToleranceVSyncEnabled" = @{ Value = 1; Type = "DWord" }
- "RtlCapabilityCheckLatency" = @{ Value = 1; Type = "DWord" }
- }
- "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Power" = @{
- "DefaultD3TransitionLatencyActivelyUsed" = @{ Value = 1; Type = "DWord" }
- "DefaultD3TransitionLatencyIdleLongTime" = @{ Value = 1; Type = "DWord" }
- "DefaultD3TransitionLatencyIdleMonitorOff" = @{ Value = 1; Type = "DWord" }
- "DefaultD3TransitionLatencyIdleNoContext" = @{ Value = 1; Type = "DWord" }
- "DefaultD3TransitionLatencyIdleShortTime" = @{ Value = 1; Type = "DWord" }
- "DefaultD3TransitionLatencyIdleVeryLongTime" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceIdle0" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceIdle0MonitorOff" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceIdle1" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceIdle1MonitorOff" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceMemory" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceNoContext" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceNoContextMonitorOff" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceOther" = @{ Value = 1; Type = "DWord" }
- "DefaultLatencyToleranceTimerPeriod" = @{ Value = 1; Type = "DWord" }
- "DefaultMemoryRefreshLatencyToleranceActivelyUsed" = @{ Value = 1; Type = "DWord" }
- "DefaultMemoryRefreshLatencyToleranceMonitorOff" = @{ Value = 1; Type = "DWord" }
- "DefaultMemoryRefreshLatencyToleranceNoContext" = @{ Value = 1; Type = "DWord" }
- "Latency" = @{ Value = 1; Type = "DWord" }
- "MaxIAverageGraphicsLatencyInOneBucket" = @{ Value = 1; Type = "DWord" }
- "MiracastPerfTrackGraphicsLatency" = @{ Value = 1; Type = "DWord" }
- "MonitorLatencyTolerance" = @{ Value = 1; Type = "DWord" }
- "MonitorRefreshLatencyTolerance" = @{ Value = 1; Type = "DWord" }
- "TransitionLatency" = @{ Value = 1; Type = "DWord" }
- }
- "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" = @{
- "VerboseStatus" = @{ Value = 1; Type = "DWord" }
- }
- }
- # Apply registry settings
- foreach ($path in $registryValues.Keys) {
- foreach ($name in $registryValues[$path].Keys) {
- $value = $registryValues[$path][$name].Value
- $type = $registryValues[$path][$name].Type
- Set-RegistryValue -path $path -name $name -value $value -type $type -Force #Added -Force to overwrite current values.
- }
- }
- # BCDEdit commands
- bcdedit /set linearaddress57 OptOut
- bcdedit /set increaseuserva 268435328
- bcdedit /set firstmegabytepolicy UseAll
- bcdedit /set avoidlowmemory 0x8000000
- bcdedit /set nolowmem Yes
- bcdedit /set allowedinmemorysettings 0x0
- bcdedit /set isolatedcontext No
- bcdedit /set vsmlaunchtype Off
- bcdedit /set vm No
- bcdedit /set x2apicpolicy Enable
- bcdedit /set configaccesspolicy Default
- bcdedit /set MSI Default
- bcdedit /set usephysicaldestination No
- bcdedit /set usefirmwarepcisettings No
- bcdedit /deletevalue useplatformclock
- bcdedit /deletevalue disabledynamictick
- bcdedit /set useplatformtick Yes
- bcdedit /set tscsyncpolicy Enhanced
- bcdedit /set disableelamdrivers Yes
- # Netsh commands
- netsh int tcp set global autotuning=experimental
- netsh int tcp set supp internet congestionprovider=newreno
- netsh int udp set global uro=enabled
- netsh int teredo set state natawareclient
- netsh int 6to4 set state state=enabled
- netsh advfirewall set allprofiles state on
- netsh winsock set autotuning on
- # PowerShell commands
- Disable-MMAgent -MemoryCompression -ErrorAction SilentlyContinue
- Get-NetAdapter -IncludeHidden | Set-NetIPInterface -WeakHostSend Enabled -WeakHostReceive Enabled -ErrorAction SilentlyContinue
- ForEach ($v in (Get-Command -Name "Set-ProcessMitigation").Parameters["Disable"].Attributes.ValidValues) {
- if ($v.ToString()) {
- try {
- Set-ProcessMitigation -System -Disable $v.ToString() -ErrorAction Stop
- Write-Host "Setting process mitigation on: $($v.toString())" -ForegroundColor Green
- }
- catch {
- Write-Warning "Could not set process mitigation on: $($v.toString())"
- }
- }
- }
- Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\*" -Recurse -ErrorAction SilentlyContinue
- # WMIC commands
- $computerSystem = Get-CimInstance -ClassName Win32_ComputerSystem -ErrorAction SilentlyContinue
- $computerSystem.AutomaticManagedPagefile = $false
- Set-CimInstance -InputObject $computerSystem -ErrorAction SilentlyContinue
- $pageFile = Get-CimInstance -ClassName Win32_PageFileSetting -Filter "Name='C:\\pagefile.sys'" -ErrorAction SilentlyContinue
- $pageFile.InitialSize = 32768
- $pageFile.MaximumSize = 32768
- Set-CimInstance -InputObject $pageFile -ErrorAction SilentlyContinue
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement