Hi Jens,
Try:
'=================>>
Function SettingVaL(strSetting As String)
Dim strComputer As String
Dim strKeyPath As String
Dim strEntryName As Variant
Dim strValue As String
Dim strLogFile As String
Dim objReg As Object
Dim objFSO As Object
Dim arrValue, byteValue, arrEntryNames, arrValueTypes
Const HKEY_USERS = &H80000003
Const HKEY_CURRENT_USER = &H80000001
Const REG_SZ = 1
Const REG_EXPAND_SZ = 2
Const REG_BINARY = 3
Const REG_DWORD = 4
Const REG_MULTI_SZ = 7
strKeyPath = ".DEFAULT\Control Panel\International"
strLogFile = "C:\RegionalSettings.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
''Set objLogFile = objFSO.CreateTextFile(strLogFile)
'''objLogFile.Writeline ("This logfile was made on " _
& Date & " at " & Time & "." & VbCrLf )
strComputer = "."
' Connect to the WMI Regisitry-provider
Set objReg = GetObject("winmgmts:{impersonationLevel" _
& "=impersonate}!\\" & strComputer _
& "\root\default:StdRegProv")
objReg.EnumValues HKEY_USERS, strKeyPath, _
arrEntryNames, arrValueTypes
For Each strEntryName In arrEntryNames
'*** This is the only Binary value
If strEntryName = "DefaultBlindDialFlag" Then
objReg.GetBinaryValue HKEY_USERS, strKeyPath, _
strEntryName, arrValue
For Each byteValue In arrValue
If strEntryName = "s" & strSetting Then
SettingVaL = strValue
Exit Function
End If
Next
Else
'*** These are all RegSZ value's
objReg.GetStringValue HKEY_USERS, strKeyPath, _
strEntryName, strValue
If strEntryName = "s" & strSetting Then
SettingVaL = strValue
Exit Function
End If
End If
Next
End Function
'<<=================
'=================>>
Sub GetDateFormat()
Dim ShortDt As String
Dim LongDt As String
ShortDt = SettingVaL("ShortDate")
LongDt = SettingVaL("LongDate")
MsgBox ShortDt & vbNewLine & LongDt
End Sub
'<<=================