Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for country.bat

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

  1. @ECHO OFF
  2. :: Country.bat,  Version 4.00
  3. :: Read the country name from the registry and store
  4. :: the value in an environment variable "Country"
  5. ::
  6. :: Usage:  COUNTRY
  7. ::
  8. :: Written by Rob van der Woude
  9. :: http://www.robvanderwoude.com
  10.  
  11. :: Command for ancient versions of REG.EXE
  12. FOR /F "tokens=2*" %%A IN ('REG QUERY "HKCU\Control Panel\International\sCountry"    2^>NUL') DO SET Country=%%B
  13. :: Command for more recent versions of REG.EXE
  14. FOR /F "tokens=2*" %%A IN ('REG QUERY "HKCU\Control Panel\International" /v sCountry 2^>NUL') DO SET Country=%%B
  15. ECHO Country=%Country%
  16.  

page last uploaded: 2017-04-06, 13:33