@@echo off
:: This script does a lot of the donkey work in setting up NickN's
:: XP tuning procedure.
:: Left to do manually are
::      delete windows prefetch directory contents
::      clear and rebuild the pagefile
::      disable system restore
::      change IE settings
::      disable indexing
::      do the defrag passes

ver|findstr /C:"Version 6" > nul
if %ERRORLEVEL% EQU 0 GOTO VISTA

ver|findstr /C:"Version 5.1" > nul
if %ERRORLEVEL% EQU 0 GOTO XP

echo Cannot detect either XP or VISTA
echo Better not proceed

goto done


:VISTA

set VISTA=1
:: keep the above line
::
echo Not tested on vista

goto done


:XP
set XP=1
echo Setting explorer preferences

for %%i in (SeparateProcess,ShowSuperHidden,Hidden) do (
        echo %%i on
        reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v %%i /t REG_DWORD /d 00000001 /f >NUL
)

for %%i in (ListviewWatermark,TaskbarAnimations,ListviewAlphaSelect,WebView,HideFileExt,SuperHidden) do (
        echo %%i off
        reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v %%i /t REG_DWORD /d 00000000 /f >NUL
)

echo disable error reporting

reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\PCHealth\ErrorReporting" /v  AllOrNone /t REG_DWORD /d 00000003 /f >NUL
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\PCHealth\ErrorReporting" /v  DoReport /t REG_DWORD /d 00000000 /f >NUL
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\PCHealth\ErrorReporting" /v  IncludeKernelFaults /t REG_DWORD /d 00000000 /f >NUL

echo VisualFXSetting 3
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v "VisualFXSetting" /t REG_DWORD /d 00000003 /f >NUL

echo UserPreferencesMask: system-advanced-performance-visual bitmask.
reg add "HKCU\Control Panel\Desktop" /v "UserPreferencesMask" /t REG_BINARY /d f0135b05 /f >NUL

echo Disable screensaver
reg add "HKCU\Control Panel\Desktop" /v "ScreenSaveActive" /t REG_SZ /d 0 /f >NUL

::echo NoDriveTypeAutoRun
::reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /t REG_BINARY /d ffffffff /f /v "NoDriveTypeAutoRun" >NUL

echo NTFS Settings
reg add HKLM\SYSTEM\CurrentControlSet\Control\filesystem /v NtfsDisableLastAccessUpdate /t REG_DWORD /d 00000001 /f >NUL

echo Crashcontrol
reg add HKLM\SYSTEM\CurrentControlSet\Control\CrashControl /v AutoReboot /t REG_DWORD /d 00000000 /f >NUL
reg add HKLM\SYSTEM\CurrentControlSet\Control\CrashControl /v SendAlert /t REG_DWORD /d 00000000 /f >NUL

echo Prefetch and boot optimisation
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters" /v "EnablePrefetcher" /t REG_DWORD /d 00000002 /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction" /v enable /t REG_SZ /d "N" /f >NUL

echo setting recycle bin to 1 percent on all drives
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket /v Percent /t REG_DWORD /d 00000001 /f >NUL
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket /v UseGlobalSettings /t REG_DWORD /d 00000001 /f >NUL

echo power settings
powercfg /setactive "always on"
powercfg /change "always on" /monitor-timeout-ac 0
powercfg /change "always on" /disk-timeout-ac 0
powercfg /hibernate off

:services
echo shutting off services
for %%i in (Alerter, ClipSrv, CiSvc, ERSvc, Messenger, mnmsrvc, NetDDE, NetDDEdsdm, SysmonLog, RemoteRegistry, RemoteAccess, wscsvc, srservice, TlntSvr, wuauserv) do (
        echo %%i
        sc stop "%%i" 2>NUL
        sc config "%%i" start= disabled
)

:performance
echo disabling performance monitoring
:: get listing of all services to a file
:: step through them looking for a 'performance' subkey
:: If found disable it
reg query HKLM\system\currentcontrolset\services > %temp%\services.list
for /F %%i in (%temp%\services.list) do (
        reg query %%i\performance > NUL 2> NUL
        if not errorlevel 1 (
                echo disabling Performance Monitoring on %%i
                reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%i\Performance" /v "Disable Performance Counters" /t REG_DWORD  /d  00000001 /f >NUL
        )
)
del %temp% /q /f

:: reenable for OS and Proc
for %%i in (PerfOS,PerfProc) do (
        reg query "HKLM\SYSTEM\CurrentControlSet\Services\%%i\performance" >NUL 2>NUL
        if not errorlevel 1 (
        echo enabling Performance Monitoring on %%i
        reg add "HKLM\SYSTEM\CurrentControlSet\Services\%%i\Performance" /v "Disable Performance Counters" /t REG_DWORD  /d  00000000 /f >NUL
        )
)
echo cleaning up

del %windows%\temp\* /q /f /s
del %temp%\* /q /f /s
del "%userprofile%\Local Settings\Temporary Internet Files\*"  /q /f /s

del %HOMEDRIVE%\NVIDIA /q /f /s
del %HOMEDRIVE%\ATI /q /f /s

goto done

any comments or specimen data, registry exports etc here

:done
pause
Hosted by www.Geocities.ws

1