<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS/JS: узнать версию файла на сетевом компьютере]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=8464&amp;type=atom" />
	<updated>2013-07-13T16:45:08Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=8464</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73747#p73747" />
			<content type="html"><![CDATA[<p><strong>Flasher</strong>, не доглядел.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2013-07-13T16:45:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73747#p73747</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73707#p73707" />
			<content type="html"><![CDATA[<p><strong>alexii</strong> &gt;<br /></p><div class="quotebox"><cite>Крепыш пишет:</cite><blockquote><p>глубина вложенности может быть любой<br />...без первых трёх элементов...</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2013-07-13T08:22:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73707#p73707</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73706#p73706" />
			<content type="html"><![CDATA[<p><strong>Крепыш</strong>, <span style="color: Green">во-первых, не превращаем тему в чат: один вопрос — одна тема.</span> Во-вторых, для решения указанного вопроса есть метод «.GetFileName()» объекта «Scripting.FileSystemObject».</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2013-07-13T01:39:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73706#p73706</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73674#p73674" />
			<content type="html"><![CDATA[<p>Сделал с помощью рег. выражения. Код на JScript:<br /></p><div class="codebox"><pre><code>Name = FileName.match(/\\\\.+?\\.+?\\.+?\\(.+)?/)[1]</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Крепыш]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=20359</uri>
			</author>
			<updated>2013-07-12T08:53:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73674#p73674</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73671#p73671" />
			<content type="html"><![CDATA[<p>Теперь вот такая задачка: есть путь к файлу:</p><p><strong>FileName = &quot;\\IP\Share\Folder\...\File&quot;</strong>,<br />где<br />IP - IP-адрес компьютера,<br />Share - имя расшаренного ресурса<br />Folder - имя папки в этом ресурсе<br />глубина вложенности может быть любой</p><p>Нужно вычленить путь к файлу без первых трёх элементов, т.е.:</p><p><strong>Name = &quot;...\File&quot;</strong><br />Подскажите, пожалуйста! А то сам не соображу.</p>]]></content>
			<author>
				<name><![CDATA[Крепыш]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=20359</uri>
			</author>
			<updated>2013-07-12T07:59:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73671#p73671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73668#p73668" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Крепыш пишет:</cite><blockquote><p>... видимо прав не хватает</p></blockquote></div><p>Именно так.</p>]]></content>
			<author>
				<name><![CDATA[Dmitrii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=13351</uri>
			</author>
			<updated>2013-07-12T06:25:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73668#p73668</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73667#p73667" />
			<content type="html"><![CDATA[<p><strong>Dmitrii</strong>,<br />ругается при попытке создать объект, видимо прав не хватает:</p><div class="quotebox"><blockquote><p>Разрешение отклонено: &#039;GetObject&#039;</p></blockquote></div><p><strong>Flasher</strong>,<br />чё-то я пошёл сложным путём, не знал, что есть функция GetFileVersion()</p><p>FileName - путь к файлу в расшаренной папке</p><div class="codebox"><pre><code>FileName = &quot;\\&lt;ip-адрес:&gt;\&lt;путь к файлу&gt;&quot;
MsgBox &quot;Version: &quot; &amp; CreateObject(&quot;Scripting.FileSystemObject&quot;).GetFileVersion(FileName)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Крепыш]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=20359</uri>
			</author>
			<updated>2013-07-12T05:45:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73667#p73667</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73666#p73666" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>FileName = &quot;C:\\Windows\\notepad.exe&quot;
strIP = &quot;192.168.0.1&quot;
Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot; &amp; strIP &amp; &quot;\root\CIMV2&quot;)
Set colFiles = objWMIService.ExecQuery(&quot;Select * from CIM_Datafile Where Name=&#039;&quot; &amp; FileName  &amp; &quot;&#039;&quot;)
For Each objFile in colFiles
  WScript.Echo &quot;Version: &quot; &amp; objFile.Version
Next</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Dmitrii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=13351</uri>
			</author>
			<updated>2013-07-12T03:17:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73666#p73666</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73660#p73660" />
			<content type="html"><![CDATA[<p><strong>Крепыш</strong><br />Речь про файл на сетевом диске? Если да, то:<br /></p><div class="codebox"><pre><code>F = &quot;//&lt;ip-адрес:&gt;/&lt;путь к файлу&gt;&quot;
With CreateObject(&quot;Scripting.FileSystemObject&quot;)
  Set D = .GetDrive(.GetDriveName(F)) 
  Col   = InStr(F, &quot;:&quot;)
  If D.DriveType = 3 And Col Then F = D.ShareName &amp; Mid(F, Col + 1)
  MsgBox &quot;Version: &quot; &amp; .GetFileVersion(F)
End With</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2013-07-11T17:44:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73660#p73660</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS/JS: узнать версию файла на сетевом компьютере]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=73651#p73651" />
			<content type="html"><![CDATA[<p>Скрипт выводит версию файла:</p><div class="codebox"><pre><code>Set FileName = &quot;C:\\Windows\\notepad.exe&quot;
Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\CIMV2&quot;)
Set colFiles = objWMIService.ExecQuery(&quot;Select * from CIM_Datafile Where Name = &#039;&quot; &amp; FileName  &amp; &quot;&#039;&quot;)
For Each objFile in colFiles
  WScript.Echo &quot;Version: &quot; &amp; objFile.Version
Next</code></pre></div><p>Как вывести версию файла на сетевом компьютере, задав его IP-адрес?</p>]]></content>
			<author>
				<name><![CDATA[Крепыш]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=20359</uri>
			</author>
			<updated>2013-07-11T13:57:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=73651#p73651</id>
		</entry>
</feed>
