Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem
- rem Script to fix the UK to US keyboard change
- rem Deletes HKU\%SID%\Control Panel\International and replaces it with a fixed .reg file
- rem
- :StartScript
- cls
- rem Get the username
- echo Enter the TS UserID (firstname.lastname) and press ENTER
- set /p usrName=Enter the Username :
- rem Get SID from username
- for /f "delims= " %%a in ('"wmic useraccount where name='%usrName%' get sid"') do (
- if not "%%a"=="SID" (
- set usrSID=%%a
- goto loopEnd
- )
- )
- :loopEnd
- rem Create the custom .reg file
- echo Windows Registry Editor Version 5.00 >temp.reg
- echo. >>temp.reg
- echo [HKEY_USERS\%usrSID%\Control Panel\International] >>temp.reg
- echo "Locale"="00000809" >>temp.reg
- echo "LocaleName"="en-GB" >>temp.reg
- echo "s1159"="AM" >>temp.reg
- echo "s2359"="PM" >>temp.reg
- echo "sCountry"="United Kingdom" >>temp.reg
- echo "sCurrency"="£" >>temp.reg
- echo "sDate"="/" >>temp.reg
- echo "sDecimal"="." >>temp.reg
- echo "sGrouping"="3;0" >>temp.reg
- echo "sLanguage"="ENG" >>temp.reg
- echo "sList"="," >>temp.reg
- echo "sLongDate"="dd MMMM yyyy" >>temp.reg
- echo "sMonDecimalSep"="." >>temp.reg
- echo "sMonGrouping"="3;0" >>temp.reg
- echo "sMonThousandSep"="," >>temp.reg
- echo "sNativeDigits"="0123456789" >>temp.reg
- echo "sNegativeSign"="-" >>temp.reg
- echo "sPositiveSign"="" >>temp.reg
- echo "sShortDate"="dd/MM/yyyy" >>temp.reg
- echo "sThousand"="," >>temp.reg
- echo "sTime"=":" >>temp.reg
- echo "sTimeFormat"="HH:mm:ss" >>temp.reg
- echo "sShortTime"="HH:mm" >>temp.reg
- echo "sYearMonth"="MMMM yyyy" >>temp.reg
- echo "iCalendarType"="1" >>temp.reg
- echo "iCountry"="44" >>temp.reg
- echo "iCurrDigits"="2" >>temp.reg
- echo "iCurrency"="0" >>temp.reg
- echo "iDate"="1" >>temp.reg
- echo "iDigits"="2" >>temp.reg
- echo "NumShape"="1" >>temp.reg
- echo "iFirstDayOfWeek"="0" >>temp.reg
- echo "iFirstWeekOfYear"="2" >>temp.reg
- echo "iLZero"="1" >>temp.reg
- echo "iMeasure"="0" >>temp.reg
- echo "iNegCurr"="1" >>temp.reg
- echo "iNegNumber"="1" >>temp.reg
- echo "iPaperSize"="9" >>temp.reg
- echo "iTime"="1" >>temp.reg
- echo "iTimePrefix"="0" >>temp.reg
- echo "iTLZero"="1" >>temp.reg
- echo. >>temp.reg
- echo [HKEY_USERS\%usrSID%\Control Panel\International\Geo] >>temp.reg
- echo "Nation"="242" >>temp.reg
- echo. >>temp.reg
- echo [HKEY_USERS\%usrSID%\Control Panel\International\User Profile] >>temp.reg
- echo "Languages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00 >>temp.reg
- echo "ShowAutoCorrection"=dword:00000001 >>temp.reg
- echo "ShowTextPrediction"=dword:00000001 >>temp.reg
- echo "ShowCasing"=dword:00000001 >>temp.reg
- echo "ShowShiftLock"=dword:00000001 >>temp.reg
- echo "UserLocaleFromLanguageProfileOptOut"=dword:00000001 >>temp.reg
- echo. >>temp.reg
- echo [HKEY_USERS\%usrSID%\Control Panel\International\User Profile\en-GB] >>temp.reg
- echo "CachedLanguageName"="@Winlangdb.dll,-1110" >>temp.reg
- echo "0809:00000809"=dword:00000001 >>temp.reg
- echo temp.reg has been created
- timeout 5
- rem Delete registry keys
- reg delete "HKEY_USERS\%usrSID%\Control Panel\International" /f
- echo HKEY_USERS\%usrSID%\Control Panel\International has been deleted
- timeout 5
- rem Import registry keys
- reg import temp.reg
- echo imported temp.reg
- timeout 5
- :ExitScript
- timeout 10
- if exist temp.reg del temp.reg
- set /P restartScript=Press any key to exit or R to run again. Then press Enter :
- if /I '%restartScript%'=='R' goto StartScript
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement