Hello world,

when I alter the locale setting in a VBScript (SetLocale), will the change
only be valid within that VBScript file or will it permanently change the
computer's locale setting (even after the script is done)?

Jens

Re: SetLocale Question by Michael

Michael
Sat Jan 17 01:03:52 CST 2004

> when I alter the locale setting in a VBScript (SetLocale), will the
> change only be valid within that VBScript file or will it permanently
> change the computer's locale setting (even after the script is done)?


The scope of SetLocale is that specific script instance only...


--
Michael Harris
Microsoft.MVP.Scripting

Windows 2000 Scripting Guide
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp

TechNet Script Center Sample Scripts
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942

WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en


Re: SetLocale Question by Jens

Jens
Sat Jan 17 03:01:04 CST 2004

> The scope of SetLocale is that specific script instance only...

Thanks!

Re: SetLocale Question by Torgeir

Torgeir
Sat Jan 17 14:20:08 CST 2004

Jens Lenge wrote:

> when I alter the locale setting in a VBScript (SetLocale), will the change
> only be valid within that VBScript file or will it permanently change the
> computer's locale setting (even after the script is done)?

Hi

As Michael wrote, it's for the script instance only. Especially when writing a
script with a potential "international" use and that that deals with the
decimal symbol is some way or another, it is very important to use the
SetLocale to avoid errors (in the US, a period is used for the decimal symbol,
but e.g. in Norway it is a comma).

Here is an example on this:
http://groups.google.com/groups?selm=400730EC.F3E85283@hydro.com


In those type of situations, I try to always remember to put <SetLocale
"en-us"> in the script (and if I need to type the decimal symbol use a period),
some examples here:

http://groups.google.com/groups?as_epq=SetLocale%20en-us&as_ugroup=microsoft.public.*&as_uauthors=torgeir%20bakken



--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter