Тема: VBS: Не проходит запрос в windows 8
Добрый день!
Есть скрипт vbs который определяет тип и разрядность windows и в зависимости от этого запускает конкретный файл установки.
Option Explicit
Dim strShare
Dim strComputer
Dim objFSO
Dim objSWbemLocator
Dim objSWbemServicesEx
Dim collSWbemObjectSet
Dim objSWbemObjectEx
Set objFSO = WScript.CreateObject("Scripting.FileSystemObject")
Dim strCommandLine
Dim lngProcessID
strComputer = "."
strShare = objFSO.GetParentFolderName(WScript.ScriptFullName)
Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
Set objSWbemLocator = WScript.CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServicesEx = objSWbemLocator.ConnectServer(strComputer, "root\cimv2")
Set collSWbemObjectSet = objSWbemServicesEx.InstancesOf("Win32_OperatingSystem")
For Each objSWbemObjectEx In collSWbemObjectSet
With objSWbemObjectEx
Select Case .Version
Case "5.1.2600" ' Windows XP X86
strCommandLine = strShare & "\xp\x86\46_xp.exe"
Case "5.2.3790" ' Windows XP X64 (& Windows Server 2003)
strCommandLine = strShare & "\xp\x64\46_xp.exe"
Case "6.1.7600", "6.1.7601" ' Windows 7 (& Windows Server 2008 R2)
Select Case .OSArchitecture
Case "32-bit" ' X86
strCommandLine = strShare & "\7\x86\46_7.exe"
Case "64-bit" ' X64
strCommandLine = strShare & "\7\x64\46_7.exe"
End Select
Case Else
' Nothing to do
End Select
End With
Next
If Not IsEmpty(strCommandLine) Then
If objSWbemServicesEx.Get("Win32_Process").Create("""" & strCommandLine & """", Empty, Nothing, lngProcessID) = 0 Then
Else
End If
End If
Set collSWbemObjectSet = Nothing
Set objSWbemServicesEx = Nothing
Set objSWbemLocator = Nothing
Set WshShell = Nothing
WScript.Quit 0
Хочу добавить в код определение windows 8, но он не обрабатывается.
Case "6.2.9200" ' Windows 8 (& Windows Server 2012 R2)
Select Case .OSArchitecture
Case "x86-based pc" ' X86
strCommandLine = strShare & "\8\x86\46_7.exe"
Case "x64-based pc" ' X64
strCommandLine = strShare & "\8\x64\46_7.exe"
End Select
Что я сделал не так?