If CheckBox.Checked = True Then
Dim regKey As RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Low Latency", True)
regKey.SetValue("Background Only", "False")
regKey.SetValue("Scheduling Category", "High")
regKey.SetValue("SFIO Priority", "High")
regKey.SetValue("Priority", "1", Microsoft.Win32.RegistryValueKind.DWord)
regKey.SetValue("Clock Rate", "2710", Microsoft.Win32.RegistryValueKind.DWord)
regKey.SetValue("GPU Priority", "2", Microsoft.Win32.RegistryValueKind.DWord)
regKey.SetValue("Latency Sensitive", "True")
regKey.Close()
Else
Dim regKey As RegistryKey regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile\Tasks\Low Latency", True)
regKey.SetValue("Background Only", "True")
regKey.SetValue("Scheduling Category", "Normal")
regKey.SetValue("SFIO Priority", "Normal")
regKey.SetValue("Priority", "0", Microsoft.Win32.RegistryValueKind.DWord)
regKey.SetValue("Clock Rate", "2710", Microsoft.Win32.RegistryValueKind.DWord)
regKey.SetValue("GPU Priority", "1", Microsoft.Win32.RegistryValueKind.DWord)
regKey.SetValue("Latency Sensitive", "False")
regKey.Close()
End If
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\Desktop", "HungAppTimeout", 1000, RegistryValueKind.String)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\Desktop", "WaitToKillAppTimeout", 1000, RegistryValueKind.String)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control", "WaitToKillServiceTimeout", 2000, RegistryValueKind.String)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management", "DisablePagingExecutive", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters", "EnableSuperfetch", 3, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters", "EnablePrefetcher", 3, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction", "Enable", "y", RegistryValueKind.String)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem", "NtfsDisableLastAccessUpdate", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU", "NoAutoRebootWithLoggedOnUsers", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\wscsvc", "Start", 4, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "MaxConnectionsPer1_0Server", 10, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "MaxConnectionsPerServer", 10, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPER1_0SERVER", "iexplore.exe", 10, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_MAXCONNECTIONSPERSERVER", "iexplore.exe", 10, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile", "NetworkThrottlingIndex", -1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Psched", "NonBestEffortLimit", 10, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\Desktop", "ForegroundLockTimeout", 0, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "EnableBalloonTips", 0, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "StartButtonBalloonTip", 0, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\Desktop", "MenuShowDelay", 100, RegistryValueKind.String)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSMQ\Parameters", "TCPNoDelay", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "TCPNoDelay", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "TcpAckFrequency", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "DesktopLivePreviewHoverTime", 0, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickHeight", 30, RegistryValueKind.String)
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickWidth", 30, RegistryValueKind.String)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\0cc5b647-c1df-4637-891a-dec35c318583", "ValueMax", 0, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "DefaultTTL", 64, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "EnableTCPA", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "TcpTimedWaitDelay", 30, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "Tcp1323Opts", 30, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "SynAttackProtect", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "EnableDca", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "TCPMaxDataRetransmissions", 7, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Psched", "NonBestEffortLimit", "0", RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "EnablePMTUDiscovery", 1, RegistryValueKind.DWord)
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces", "EnablePMTUBHDetect", 0, RegistryValueKind.DWord)
Try
Microsoft.VisualBasic.Interaction.Shell("CMD.exe /C netsh int tcp show global", AppWinStyle.NormalNoFocus)
Microsoft.VisualBasic.Interaction.Shell("CMD.exe /C netsh int tcp set heuristics disabled", AppWinStyle.NormalNoFocus)
Microsoft.VisualBasic.Interaction.Shell("CMD.exe /C netsh int tcp set global autotuninglevel=disabled", AppWinStyle.NormalNoFocus)
Microsoft.VisualBasic.Interaction.Shell("CMD.exe /C netsh int tcp set global congestionprovider=ctcp", AppWinStyle.NormalNoFocus)
Microsoft.VisualBasic.Interaction.Shell("CMD.exe /C netsh int tcp set global ecncapability=default", AppWinStyle.NormalNoFocus)
Microsoft.VisualBasic.Interaction.Shell("CMD.exe /C netsh int tcp set global rss=enabled", AppWinStyle.NormalNoFocus)
Microsoft.VisualBasic.Interaction.Shell("CMD.exe /C netsh int tcp set global chimney=enabled", AppWinStyle.NormalNoFocus)
Catch ex As Exception
MessageBox.Show("Windows feature is not found.", My.Application.Info.Description, MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 0, False)
End Try