tags:

views:

256

answers:

1

I'm running the following VBS script in Windows XP, french version, localised for Switzerland. The configured decimal symbol is . (dot) (in Settings->Regional Options)

Here is the script (named test.vbs) :

MsgBox CDbl("3.456") & vbCrLf & CLng("3.456")

If I run it from Windows (I'm using VBS Factory), it works fine.

If I run it from the command line :

cscript /nologo test.vbs

I get the following error :

test.vbs(3, 1) Error running Microsoft VBScript: Incompatible type: 'CDbl'

If I then change the script like this (changing the decimal separator from dot to coma) :

MsgBox CDbl("3,456") & vbCrLf & CLng("3,456")

Then the script works fine from the command line (but fails when launched from Windows).

It looks like in the command line, there is a different regional settings, but I have no idea why or where I could change it.

Or is there something else I'm missing ?