So i found out a solution:
Using key As RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Control\Nls\Language")
Dim value As Object = key.GetValue("Default")
Result = value
End Using
If Result = "0409" Then 'default en-US - 00000409 , ja-JP Japan - 00000411
Select Case MsgBox("Do you want the program to change it automatically?", MsgBoxStyle.YesNo, "Windows Locale Error")
Case MsgBoxResult.Yes
RunCmd("control.exe intl.cpl,, /f:""" & My.Application.Info.DirectoryPath & "\Locale.xml" & """")
MsgBox("Windows Locale Setting has been changed. PC require restart to take effect", MsgBoxStyle.OkOnly, "Windows Locale Changed")
Shell("shutdown /r -t 10") ' 00 Seconds
Case MsgBoxResult.No
Form1.CheckBoxLocale.Checked = False
End Select
Else
Form1.CheckBoxLocale.Checked = True
End If
and XML file:
<gs:GlobalizationServices xmlns:gs='urn:longhornGlobalizationUnattend'>
<gs:UserList>
<gs:User UserID='Current' CopySettingsToDefaultUserAcct='true' CopySettingsToSystemAcct='true' />
</gs:UserList>
<gs:SystemLocale Name='ja-JP' />
</gs:GlobalizationServices>
CMD Execute
Sub RunCmd(Arg As String)
Dim p As New Process()
Dim pi As New ProcessStartInfo With {
.WindowStyle = ProcessWindowStyle.Hidden,
.Verb = "runas",
.Arguments = "/c " & Arg,
.FileName = "cmd.exe"
}
p.StartInfo = pi
p.Start()
p.WaitForExit()
End Sub