Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for country3.bat

(view source code of country3.bat as plain text)

  1. @ECHO OFF
  2. :: Country.bat, Version 3.01 for Windows NT 4
  3. :: Displays several country related settings.
  4. :: This version uses native NT 4 commands only.
  5. :: Written by Rob van der Woude
  6. :: http://www.robvanderwoude.com
  7. :: Keyboard trick by Tom Lavedas
  8. :: http://web.archive.org/web/20070222072741rn_1/members.cox.net/tglbatch/
  9.  
  10. :: Export International settings from registry to a temporary file
  11. START /W REGEDIT /E %Temp%.\international.reg "HKEY_CURRENT_USER\Control Panel\International"
  12. :: Read several lines from the temporary files
  13. :: and store these settings as environment variables
  14. FOR /F "tokens=1* delims==" %%A IN ('TYPE %Temp%.\international.reg ^| FIND "iCountry"') DO SET iCountry=%%B
  15. SET iCountry=%iCountry:"=%
  16. SET iCountry
  17. FOR /F "tokens=1* delims==" %%A IN ('TYPE %Temp%.\international.reg ^| FIND "sCountry"') DO SET sCountry=%%B
  18. SET sCountry=%sCountry:"=%
  19. SET sCountry
  20. FOR /F "tokens=1* delims==" %%A IN ('TYPE %Temp%.\international.reg ^| FIND "sLanguage"') DO SET sLanguage=%%B
  21. SET sLanguage=%sLanguage:"=%
  22. SET sLanguage
  23. :: Remove temporary file
  24. DEL %Temp%.\international.reg
  25. :: The KEYB trick was posted to the alt.msdos.batch.nt newsgroup by Tom Lavedas
  26. FOR /F "tokens=1* delims=:" %%A IN ('KEYB ^| FIND ":" ^| FIND /V "CON"') DO SET Keyboard=%%B
  27. SET Keyboard=%Keyboard:~1%
  28. SET Keyboard
  29. :: Check code page used
  30. FOR /F "tokens=1* delims=:" %%A IN ('CHCP') DO SET /A CodePage = %%B
  31. SET CodePage
  32.  

page last modified: 2024-04-16; loaded in 0.0056 seconds