Jump to content


  • 0
Kingskawn

Simple vbs script needed

Question

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

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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.

 

 

Share this post


Link to post
Share on other sites

  • 0

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:\)

Share this post


Link to post
Share on other sites

  • 0

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:\)

Share this post


Link to post
Share on other sites

  • 0

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

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

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.