Skip to content

Simple vbs script needed

Featured Replies

I need a vbs script to check which language my OS is and install the adequate application.

 

I had for example the update of RDP 6.1 for SP2 that I needed to deploy but I had some 1603 errors and I couldn't figure out what was causing this. Seems that it was just the language of the OS that was not matching. So I have a WindowsXP-KB952155-x86-ENU and WindowsXP-KB952155-x86-NLD

I think it would be easier to have two collections or just use software updates to deploy this package?

To check the OS version of the computer,here is basic script which gives you OS Language and which OS it is.It will prompt for computer name which can be custmised for list of computers to output in excel sheet.

 

 

 

strcomputer= inputbox ("What computer do you wish to check? (Press Enter if this computer)","Computer")
Set objSWbemServices = GetObject("winmgmts:\\" & strComputer)
If computer="" then computer = "this computer"
Set coll = objSWbemServices.InstancesOf ("Win32_OperatingSystem")
For Each objSWbemObject In coll
Wscript.Echo objSWbemObject.OSLanguage
' Wscript.Echo objSWbemObject.CSDVERSION
Wscript.Echo objSWbemObject.caption

Next

OSLnaguage is on Windows 7 and CSD version is on Windows XP OS.change it according to the requirement.

 

 

  • Author

I think it would be easier to have two collections or just use software updates to deploy this package?

 

Ok I could deploy it with SUP but can you also deploy Mindmanager 8 with SUP? I don't think so. KB952155 was just an example of an application :rolleyes:

 

I could make 2 collections but for easier management I just want 1 collection with an advertisement and a script as program that checks for OS language or another value in the registry or filesystem (C:\)

Ok I could deploy it with SUP but can you also deploy Mindmanager 8 with SUP? I don't think so. KB952155 was just an example of an application :rolleyes:

 

I could make 2 collections but for easier management I just want 1 collection with an advertisement and a script as program that checks for OS language or another value in the registry or filesystem (C:\)

You can use the below script and modify as per your needs

 

'#############################

 

Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")

 

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

 

Set colOperatingSystems = objWMIService.ExecQuery _

("Select * from Win32_OperatingSystem")

Set WshShell = WScript.CreateObject("WScript.Shell")

 

For Each objOperatingSystem in colOperatingSystems

Wscript.Echo "OS Language: " & objOperatingSystem.OSLanguage

 

If objoperatingsystem.OSLanguage = "1033" then

MsgBox "en-US"

WshShell.Run "%windir%\notepad "

Else

MsgBox "Found non English OS then run other exe file"

End if

Next

'######################################################

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.