' Leatrix Latency Fix 1.11 ' To use, simply run this script and restart your computer. logo = "Leatrix Latency Fix" Const HKEY_LOCAL_MACHINE = &H80000002 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") Set shell = CreateObject("Shell.Application") set wsnet = WScript.CreateObject("WScript.Network") computername = ucase(wsnet.computername) strKeyPath = "SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\" oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys ' Latency fix has already been applied if CheckFix = true then msg = "It appears that the latency fix has already been applied to this computer." msg = msgbox (msg,64,logo) wscript.quit end if ' Show title for first run If WScript.Arguments.Count = 0 then msg = logo & " 1.11" & chr(13) & chr(13) & "This script will reduce your latency in World of Warcraft and other online games. It is designed for Windows XP (SP2 or higher), Windows Vista (SP1 or higher) and Windows 7 only." _ & chr(13) & chr(13) & "If you are not logged into your computer with an account which has Administrator privileges, or you are using Windows Vista or Windows 7 with User Account Control enabled, you will be prompted to enter the username and password of an account which has Administrator privileges." _ & chr(13) & chr(13) & "www.prestige-gaming.ru" _ & chr(13) & chr(13) & "Click Ok to begin." msg = msgbox (msg,65,logo) ' Does user want to quit if msg = 2 then wscript.quit end if end if ' Attempt to apply latency fix For Each subkey In arrSubKeys err = oReg.SetDwordValue (HKEY_LOCAL_MACHINE,strKeyPath & subkey,"TcpAckFrequency","1") Next ' If fix completed successfully if CheckFix = true then Success wscript.quit end if ' If fix did not complete successfully, run it again with UAC prompt if CheckFix = false and WScript.Arguments.count = 0 then msg = "Either your Windows account does not have Administrator privileges, or you are using Windows Vista or Windows 7 with User Account Control enabled." msg = msg + chr(13) + chr(13) & "User Account Control forces programs to run under regular user privileges, even if you are logged into your computer with an account which has Administrator privileges. It's enabled by default on computers running Windows Vista and Windows 7." msg = msg + chr(13) + chr(13) & "To get around this, you will be prompted to enter your Windows logon details. In the next window, check the radio button for 'The following user' and enter the username and password of a Windows account which has Administrator privileges. The username must be in the format '" & computername & "\username'." msg = msg + chr(13) + chr(13) & "Click Ok to continue" msg = msgbox (msg,49,logo) ' Does user want to quit if msg = 2 then wscript.quit end if ' Rerun script with UAC prompt shell.ShellExecute "wscript.exe", Chr(34) & _ WScript.ScriptFullName & Chr(34) & " uac", "", "runas", 1 end if ' Check if script completed successfully with UAC prompt if WScript.Arguments.count = 1 then if CheckFix = false then msg = "There was an error (" & err.number & ")." & chr(13) & chr(13) & "Ensure that you entered a valid username and password. The username must have Administrator privileges on this computer." & chr(13) & chr(13) & "Click Ok to close the script." msg = msgbox (msg,48,logo) else Success end if end if wscript.quit Function CheckFix() ' Checks to see if any of the settings have been applied, sets StopCheck to 1 if they have StopCheck = 0 For Each subkey In arrSubKeys oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath & subkey,"TcpAckFrequency",CheckFix if CheckFix = 1 then else StopCheck = 1 end if Next if StopCheck = 1 then CheckFix = false else CheckFix = true end function Function Success() set shell = wscript.CreateObject("wscript.shell") msg = "The latency fix has been applied successfully." & chr(13) & "You need to restart your computer for the changes to take effect." & chr(13) & chr(13) & "Do you want to restart your computer now?" msg = msgbox (msg,68,logo) if msg = 6 then shell.Run "shutdown.exe /r /t 00" end if end function