<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7290&amp;type=atom" />
	<updated>2012-06-26T09:57:54Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7290</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61229#p61229" />
			<content type="html"><![CDATA[<p>Думаю, делали бы сами.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-06-26T09:57:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61229#p61229</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61225#p61225" />
			<content type="html"><![CDATA[<p>Спасибо! Что бы я без вас делал!</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-26T09:06:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61225#p61225</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61221#p61221" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Бродяга пишет:</cite><blockquote><p>Что указать что бы путь был прямо от того места где запушен скрипт?</p></blockquote></div><div class="codebox"><pre><code>Dim objWshShell

Set objWshShell = CreateObject(&quot;WScript.Shell&quot;)

strShare    = objWshShell.CurrentDirectory</code></pre></div><p>Использование месторасположения скрипта в качестве исходного пути:<br /></p><div class="codebox"><pre><code>Dim objFSO

Set objFSO = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)

strShare   = objFSO.GetParentFolderName(WScript.ScriptFullName)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-06-26T08:31:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61221#p61221</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61219#p61219" />
			<content type="html"><![CDATA[<p>Последний вопрос!</p><p>strShare&nbsp; &nbsp; = &quot;C:\Users\IReshetov\Desktop\VPN\&quot;</p><p>Что указать что бы путь был прямо от того места где запушен скрипт?</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-26T07:17:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61219#p61219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61095#p61095" />
			<content type="html"><![CDATA[<p>Там есть пример:<br /></p><div class="quotebox"><blockquote><p>Другой пример:<br /></p><div class="codebox"><pre><code>Set WshShell = CreateObject(&quot;WScript.Shell&quot;)
RetCode = WshShell.Run(&quot;notepad&quot;, 1, True)
MsgBox &quot;Обработка завершена! Код возврата - &quot; &amp; RetCode</code></pre></div></blockquote></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-06-22T05:55:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61095#p61095</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61094#p61094" />
			<content type="html"><![CDATA[<p>Хм, я в этом нооб!!!</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-22T04:36:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61094#p61094</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61092#p61092" />
			<content type="html"><![CDATA[<p>Тогда используйте метод «<a href="http://www.script-coding.com/WSH/WshShell.html#3.4.">.Run</a>» объекта «Wscript.Shell» с третьим параметром, равным «True» — вместо «.Get(&quot;Win32_Process&quot;).Create()».</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-06-21T23:01:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61092#p61092</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61078#p61078" />
			<content type="html"><![CDATA[<p>Да<br />Всё правильно!</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-21T12:15:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61078#p61078</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61077#p61077" />
			<content type="html"><![CDATA[<p>То есть — а) локально и б) интерактивно. Так?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-06-21T12:09:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61077#p61077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61076#p61076" />
			<content type="html"><![CDATA[<p>Засунуть скрипт вместе с исполнительными файлами в exe файл.<br />Тоесть, запускается exe ему предлогает выбрать регион (Тверь, Москва, Курск), как только выбор сделан скрипт проверяет систему и устонавливает необходимый файл.</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-21T11:36:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61076#p61076</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61075#p61075" />
			<content type="html"><![CDATA[<p>Как Вы планируете исполнять скрипт?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-06-21T10:22:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61075#p61075</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61072#p61072" />
			<content type="html"><![CDATA[<p>И последний вопрос!<br />Немного переделал скрипт.</p><div class="codebox"><pre><code>Option Explicit

Dim strShare
Dim strComputer

Dim objSWbemLocator
Dim objSWbemServicesEx
Dim collSWbemObjectSet
Dim objSWbemObjectEx

Dim strCommandLine1
Dim strCommandLine2
Dim strCommandLine3
Dim lngProcessID

strShare    = &quot;C:\Users\IReshetov\Desktop\VPN\&quot;
strComputer = &quot;.&quot;

Set objSWbemLocator    = WScript.CreateObject(&quot;WbemScripting.SWbemLocator&quot;)
Set objSWbemServicesEx = objSWbemLocator.ConnectServer(strComputer, &quot;root\cimv2&quot;)
Set collSWbemObjectSet = objSWbemServicesEx.InstancesOf(&quot;Win32_OperatingSystem&quot;)

For Each objSWbemObjectEx In collSWbemObjectSet
    With objSWbemObjectEx
        Select Case .Version
            Case &quot;5.1.2600&quot;             &#039; Windows XP X86
                strCommandLine1 = strShare &amp; &quot;\VPN\VPN-XP\X86\MOS\VPN-77.exe&quot;
                strCommandLine2 = strShare &amp; &quot;\VPN\VPN-XP\X86\KURSK\VPN-46.exe&quot;
                strCommandLine3 = strShare &amp; &quot;\VPN\VPN-XP\X86\TVER\VPN-69.exe&quot;
            Case &quot;5.2.3790&quot;             &#039; Windows XP X64 (&amp; Windows Server 2003)
                strCommandLine1 = strShare &amp; &quot;\VPN\VPN-XP\X64\MOS\VPN-77.exe&quot;
                strCommandLine2 = strShare &amp; &quot;\VPN\VPN-XP\X64\MOS\VPN-69.exe&quot;
                strCommandLine3 = strShare &amp; &quot;\VPN\VPN-XP\X64\KURSK\VPN-46.exe&quot;
            Case &quot;6.1.7600&quot;, &quot;6.1.7601&quot; &#039; Windows 7 (&amp; Windows Server 2008 R2)
                Select Case .OSArchitecture
                    Case &quot;32-bit&quot;       &#039; X86
                        strCommandLine1 = strShare &amp; &quot;\VPN\VPN-7\X86\MOS\VPN-77.exe&quot;
                        strCommandLine2 = strShare &amp; &quot;\VPN\VPN-7\X86\KURSK\VPN-46.exe&quot;
                        strCommandLine3 = strShare &amp; &quot;\VPN\VPN-7\X86\TVER\VPN-69.exe&quot;
                    Case &quot;64-bit&quot;       &#039; X64
                        strCommandLine1 = strShare &amp; &quot;\VPN\VPN-7\X64\MOS\VPN-77.exe&quot;
                        strCommandLine2 = strShare &amp; &quot;\VPN\VPN-7\X64\TVER\VPN-69.exe&quot;
                        strCommandLine3 = strShare &amp; &quot;\VPN\VPN-7\X64\KURSK\VPN-46.exe&quot;
                End Select
            Case Else
                &#039; Nothing to do
        End Select
    End With
Next


If Not IsEmpty(strCommandLine1) Then
    If objSWbemServicesEx.Get(&quot;Win32_Process&quot;).Create(&quot;&quot;&quot;&quot; &amp; strCommandLine1 &amp; &quot;&quot;&quot;&quot;, Empty, Nothing, lngProcessID) = 0 Then
    Else
    End If
End If
If Not IsEmpty(strCommandLine2) Then
    If objSWbemServicesEx.Get(&quot;Win32_Process&quot;).Create(&quot;&quot;&quot;&quot; &amp; strCommandLine2 &amp; &quot;&quot;&quot;&quot;, Empty, Nothing, lngProcessID) = 0 Then
    Else
    End If
End If
If Not IsEmpty(strCommandLine3) Then
    If objSWbemServicesEx.Get(&quot;Win32_Process&quot;).Create(&quot;&quot;&quot;&quot; &amp; strCommandLine3 &amp; &quot;&quot;&quot;&quot;, Empty, Nothing, lngProcessID) = 0 Then
    Else
    End If
End If

Set collSWbemObjectSet = Nothing
Set objSWbemServicesEx = Nothing
Set objSWbemLocator    = Nothing

WScript.Quit 0</code></pre></div><p>Как сделать задержку или ожидание на закрытие предыдушего файла?</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-21T08:06:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61072#p61072</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61071#p61071" />
			<content type="html"><![CDATA[<p>Как правило, я использую сам и рекомендую остальным работу под консольным «cscript.exe» вместо «wscript.exe». А «убрать» вывод проще всего так:<br /></p><div class="codebox"><pre><code>cscript.exe //nologo //b &quot;Script.vbs&quot;</code></pre></div><p>или<br /></p><div class="codebox"><pre><code>wscript.exe //b &quot;Script.vbs&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-06-21T07:20:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61071#p61071</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61070#p61070" />
			<content type="html"><![CDATA[<p>Всё, разобрался!!</p><p>БОЛЬШОЕ СПАСИБО!!!</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-21T07:09:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61070#p61070</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: запуск приложения в зависимости от версии и разрядности ОС]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=61069#p61069" />
			<content type="html"><![CDATA[<p>Да. скрипт работает, по при выполнении выдаёт ощибку!<br />Successfully execute[C:\Users\...\Desktop\VPN\VPN_7_32.exe] on [.]</p><p>А потом <br />Process Id: [2228]</p><p>Можно это как то убрать?</p>]]></content>
			<author>
				<name><![CDATA[Бродяга]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28174</uri>
			</author>
			<updated>2012-06-21T07:03:23Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=61069#p61069</id>
		</entry>
</feed>
