Forum Discussion
HKosova
8 years agoSmartBear Alumni (Retired)
aqEnvironment.SetLocaleInfo lets you change individual parameters like the date/time format ot decimal separator, but not the locale itself.
Different Windows versions have different ways to change the locale programmatically:
- Windows 8+: Use the PowerShell cmdlet Set-WinSystemLocale. You can run PowerShell commands from TestComplete as explained here.
- Windows Vista, XP: run the "control intl.cpl" and pass an .xml (for Vista) or .txt (for XP) file containing the locale info. See these links for details:
https://blogs.msdn.microsoft.com/shawnste/2007/04/12/configuring-regional-and-language-options-international-settings-with-command-line-automation/
https://msdn.microsoft.com/en-us/goglobal/bb964650
https://superuser.com/questions/395818/how-to-change-keyboard-layout-via-command-line-cmd-exe-on-windows-xp-7
https://www.autoitscript.com/forum/topic/118706-fastest-way-command-line-to-change-system-locale/
To run external commands from TestComplete you can use WshShell.Run() or Sys.OleObject("WScript.Shell").Run().
If you could elaborate why you need to change the locale, we might be able to suggest a better solution.
Related Content
- 5 years agomboyce