Advertisement
Guest User

keyboardfix.cmd

a guest
Nov 21st, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.33 KB | None | 0 0
  1. @echo off
  2. rem
  3. rem Script to fix the UK to US keyboard change
  4. rem Deletes HKU\%SID%\Control Panel\International and replaces it with a fixed .reg file
  5. rem
  6.  
  7. :StartScript
  8. cls
  9.  
  10. rem Get the username
  11. echo Enter the TS UserID (firstname.lastname) and press ENTER
  12. set /p usrName=Enter the Username :
  13.  
  14. rem Get SID from username
  15. for /f "delims= " %%a in ('"wmic useraccount where name='%usrName%' get sid"') do (
  16.    if not "%%a"=="SID" (          
  17.       set usrSID=%%a
  18.       goto loopEnd
  19.    )  
  20. )
  21.  
  22. :loopEnd
  23. rem Create the custom .reg file
  24. echo Windows Registry Editor Version 5.00 >temp.reg
  25. echo. >>temp.reg
  26. echo [HKEY_USERS\%usrSID%\Control Panel\International] >>temp.reg
  27. echo "Locale"="00000809" >>temp.reg
  28. echo "LocaleName"="en-GB" >>temp.reg
  29. echo "s1159"="AM" >>temp.reg
  30. echo "s2359"="PM" >>temp.reg
  31. echo "sCountry"="United Kingdom" >>temp.reg
  32. echo "sCurrency"="£" >>temp.reg
  33. echo "sDate"="/" >>temp.reg
  34. echo "sDecimal"="." >>temp.reg
  35. echo "sGrouping"="3;0" >>temp.reg
  36. echo "sLanguage"="ENG" >>temp.reg
  37. echo "sList"="," >>temp.reg
  38. echo "sLongDate"="dd MMMM yyyy" >>temp.reg
  39. echo "sMonDecimalSep"="." >>temp.reg
  40. echo "sMonGrouping"="3;0" >>temp.reg
  41. echo "sMonThousandSep"="," >>temp.reg
  42. echo "sNativeDigits"="0123456789" >>temp.reg
  43. echo "sNegativeSign"="-" >>temp.reg
  44. echo "sPositiveSign"="" >>temp.reg
  45. echo "sShortDate"="dd/MM/yyyy" >>temp.reg
  46. echo "sThousand"="," >>temp.reg
  47. echo "sTime"=":" >>temp.reg
  48. echo "sTimeFormat"="HH:mm:ss" >>temp.reg
  49. echo "sShortTime"="HH:mm" >>temp.reg
  50. echo "sYearMonth"="MMMM yyyy" >>temp.reg
  51. echo "iCalendarType"="1" >>temp.reg
  52. echo "iCountry"="44" >>temp.reg
  53. echo "iCurrDigits"="2" >>temp.reg
  54. echo "iCurrency"="0" >>temp.reg
  55. echo "iDate"="1" >>temp.reg
  56. echo "iDigits"="2" >>temp.reg
  57. echo "NumShape"="1" >>temp.reg
  58. echo "iFirstDayOfWeek"="0" >>temp.reg
  59. echo "iFirstWeekOfYear"="2" >>temp.reg
  60. echo "iLZero"="1" >>temp.reg
  61. echo "iMeasure"="0" >>temp.reg
  62. echo "iNegCurr"="1" >>temp.reg
  63. echo "iNegNumber"="1" >>temp.reg
  64. echo "iPaperSize"="9" >>temp.reg
  65. echo "iTime"="1" >>temp.reg
  66. echo "iTimePrefix"="0" >>temp.reg
  67. echo "iTLZero"="1" >>temp.reg
  68. echo. >>temp.reg
  69. echo [HKEY_USERS\%usrSID%\Control Panel\International\Geo] >>temp.reg
  70. echo "Nation"="242" >>temp.reg
  71. echo. >>temp.reg
  72. echo [HKEY_USERS\%usrSID%\Control Panel\International\User Profile] >>temp.reg
  73. echo "Languages"=hex(7):65,00,6e,00,2d,00,47,00,42,00,00,00 >>temp.reg
  74. echo "ShowAutoCorrection"=dword:00000001 >>temp.reg
  75. echo "ShowTextPrediction"=dword:00000001 >>temp.reg
  76. echo "ShowCasing"=dword:00000001 >>temp.reg
  77. echo "ShowShiftLock"=dword:00000001 >>temp.reg
  78. echo "UserLocaleFromLanguageProfileOptOut"=dword:00000001 >>temp.reg
  79. echo. >>temp.reg
  80. echo [HKEY_USERS\%usrSID%\Control Panel\International\User Profile\en-GB] >>temp.reg
  81. echo "CachedLanguageName"="@Winlangdb.dll,-1110" >>temp.reg
  82. echo "0809:00000809"=dword:00000001 >>temp.reg
  83. echo temp.reg has been created
  84. timeout 5
  85.  
  86. rem Delete registry keys
  87. reg delete "HKEY_USERS\%usrSID%\Control Panel\International" /f
  88. echo HKEY_USERS\%usrSID%\Control Panel\International has been deleted
  89. timeout 5
  90.  
  91. rem Import registry keys
  92. reg import temp.reg
  93. echo imported temp.reg
  94. timeout 5
  95.  
  96. :ExitScript
  97. timeout 10
  98. if exist temp.reg del temp.reg
  99. set /P restartScript=Press any key to exit or R to run again. Then press Enter :
  100. if /I '%restartScript%'=='R' goto StartScript
  101. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement