И последний вопрос!
Немного переделал скрипт.
Option Explicit
Dim strShare
Dim strComputer
Dim objSWbemLocator
Dim objSWbemServicesEx
Dim collSWbemObjectSet
Dim objSWbemObjectEx
Dim strCommandLine1
Dim strCommandLine2
Dim strCommandLine3
Dim lngProcessID
strShare = "C:\Users\IReshetov\Desktop\VPN\"
strComputer = "."
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
strCommandLine1 = strShare & "\VPN\VPN-XP\X86\MOS\VPN-77.exe"
strCommandLine2 = strShare & "\VPN\VPN-XP\X86\KURSK\VPN-46.exe"
strCommandLine3 = strShare & "\VPN\VPN-XP\X86\TVER\VPN-69.exe"
Case "5.2.3790" ' Windows XP X64 (& Windows Server 2003)
strCommandLine1 = strShare & "\VPN\VPN-XP\X64\MOS\VPN-77.exe"
strCommandLine2 = strShare & "\VPN\VPN-XP\X64\MOS\VPN-69.exe"
strCommandLine3 = strShare & "\VPN\VPN-XP\X64\KURSK\VPN-46.exe"
Case "6.1.7600", "6.1.7601" ' Windows 7 (& Windows Server 2008 R2)
Select Case .OSArchitecture
Case "32-bit" ' X86
strCommandLine1 = strShare & "\VPN\VPN-7\X86\MOS\VPN-77.exe"
strCommandLine2 = strShare & "\VPN\VPN-7\X86\KURSK\VPN-46.exe"
strCommandLine3 = strShare & "\VPN\VPN-7\X86\TVER\VPN-69.exe"
Case "64-bit" ' X64
strCommandLine1 = strShare & "\VPN\VPN-7\X64\MOS\VPN-77.exe"
strCommandLine2 = strShare & "\VPN\VPN-7\X64\TVER\VPN-69.exe"
strCommandLine3 = strShare & "\VPN\VPN-7\X64\KURSK\VPN-46.exe"
End Select
Case Else
' Nothing to do
End Select
End With
Next
If Not IsEmpty(strCommandLine1) Then
If objSWbemServicesEx.Get("Win32_Process").Create("""" & strCommandLine1 & """", Empty, Nothing, lngProcessID) = 0 Then
Else
End If
End If
If Not IsEmpty(strCommandLine2) Then
If objSWbemServicesEx.Get("Win32_Process").Create("""" & strCommandLine2 & """", Empty, Nothing, lngProcessID) = 0 Then
Else
End If
End If
If Not IsEmpty(strCommandLine3) Then
If objSWbemServicesEx.Get("Win32_Process").Create("""" & strCommandLine3 & """", Empty, Nothing, lngProcessID) = 0 Then
Else
End If
End If
Set collSWbemObjectSet = Nothing
Set objSWbemServicesEx = Nothing
Set objSWbemLocator = Nothing
WScript.Quit 0
Как сделать задержку или ожидание на закрытие предыдушего файла?