OS Language using Vb script




Retrieve OS Language using Vb script
Given below is the code to retrieve OS language installed in a Computer using vb script
Implementation

Const OSQuery= "Select * from Win32_OperatingSystem"
Const PS1Cmd = "& {(Get-Culture).DisplayName}"

Set WshShell = WScript.CreateObject("WScript.Shell")
	Set objWMIService = GetObject("winmgmts:\\" & "." & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery (OSQuery)
	For Each objOperatingSystem in colOperatingSystems
				Set oExec = WshShell.Exec("powershell -command """ & PS1Cmd & """ ")
		strValue=oExec.StdOut.ReadLine()
		wscript.echo "OS Langauge :-" &  strValue
	Next
	

 

HappyCoding ! 😉

Leave a comment