<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS: сложение времени]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10358&amp;type=atom" />
	<updated>2015-09-13T15:01:25Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10358</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97395#p97395" />
			<content type="html"><![CDATA[<p>Стандартными методами нельзя.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-09-13T15:01:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97395#p97395</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=97393#p97393" />
			<content type="html"><![CDATA[<p>Вопрос, не совсем по теме.<br />Можно ли без вызова mediainfo.dll узнать длительность видео с точностью до кадра?</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2015-09-13T14:31:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=97393#p97393</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=96024#p96024" />
			<content type="html"><![CDATA[<p><strong>griha09</strong>, с этим, я так понимаю, <a href="http://forum.script-coding.com/viewtopic.php?id=10759">сюда</a>.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-07-25T18:40:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=96024#p96024</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=96021#p96021" />
			<content type="html"><![CDATA[<p>Flasher, решил чуть переделать вашу процедуру вот так<br /></p><div class="codebox"><pre><code>Sub FFolder(Folder, Folder2)
  Set Folder = Shell.NameSpace(Folder)
  Set Items  = Folder.Items
  Items.Filter 192, Exts
  For Each File in Items
objFSO.MoveFile File, Folder2+File.Name 
  Next
End Sub</code></pre></div><p> чтоб после отсортировки переносить отсортированные видеофайлы, да в цикле выдает только имя(без расширения) файла. Не&nbsp; подкажите как получить полное имя с путем для переноса файла?</p>]]></content>
			<author>
				<name><![CDATA[griha09]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27540</uri>
			</author>
			<updated>2015-07-25T18:02:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=96021#p96021</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=95148#p95148" />
			<content type="html"><![CDATA[<p>Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[griha09]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27540</uri>
			</author>
			<updated>2015-07-08T20:26:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=95148#p95148</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=95147#p95147" />
			<content type="html"><![CDATA[<p>Раскладываем на 3 строчки.<br /></p><div class="codebox"><pre><code>Dim A(0) &#039; объявляем массив, 0 - один элемент массива
A(0) = 0 &#039; устанавливаем первичное значение первого и, соотв., единственного элемента массива
FFolder CD &#039; вызываем процедуру, подставляя путь рабочей папки в качестве её аргумента</code></pre></div><p>Время жизни переменной в процедуре длится, как известно, до окончания её отработки, в то время как элемент массива (как и элемент коллекции) позволяет не терять обновляемое в ней значение.</p>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-07-08T20:23:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=95147#p95147</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=95146#p95146" />
			<content type="html"><![CDATA[<p><strong>Flasher</strong>, продолжая мой вопрос. Здесь перечислены переменные? Что означает FFolder CD?</p><div class="codebox"><pre><code>Dim A(0) : A(0) = 0 : FFolder CD</code></pre></div>]]></content>
			<author>
				<name><![CDATA[griha09]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27540</uri>
			</author>
			<updated>2015-07-08T20:09:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=95146#p95146</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90956#p90956" />
			<content type="html"><![CDATA[<p>Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[griha09]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27540</uri>
			</author>
			<updated>2015-01-25T16:33:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90956#p90956</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90859#p90859" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>&#039; Подсчёт общей длительности доступных видео-файлов в структуре данного каталога

Set Shell = CreateObject(&quot;Shell.Application&quot;)
CD = CreateObject(&quot;WScript.Shell&quot;).CurrentDirectory
Exts = &quot;*.3gp;*.asf;*.avi;*.mov;*.mp4;*.mpg;*.wmv;*.vob&quot;
Dim A(0) : A(0) = 0 : FFolder CD
D = Int(A(0)/86400) : H1 = A(0) - (D * 86400)
H = Int(H1/3600)    : M1 = H1   - (H * 3600)
M = Int(M1/60)      : S  = M1   - (M * 60)
If D = 0 Then D = &quot;&quot; Else D = D &amp; &quot; дн. &quot;
MsgBox &quot;Общая продолжительность доступных видео-файлов &quot; &amp; _
&quot;структуры папки &quot;&quot;&quot; &amp; CD &amp; &quot;&quot;&quot;: &quot; &amp; D &amp; TimeSerial(H, M, S), 64

Sub FFolder(Folder)
  Set Folder = Shell.NameSpace(Folder)
  Set Items  = Folder.Items
  Items.Filter 192, Exts
  For Each File in Items
    Dur = Folder.GetDetailsOf(File, 27)
    If Dur &lt;&gt; &quot;&quot; Then A(0) = A(0) + DateDiff(&quot;s&quot;, 0, Dur)
  Next : Items.Filter 160, &quot;*&quot;
  For Each Fd In Items : FFolder Fd.Path : Next
End Sub</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Flasher]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27593</uri>
			</author>
			<updated>2015-01-21T22:09:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90859#p90859</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90855#p90855" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>griha09 пишет:</cite><blockquote><p>... но затык с сложением времени</p></blockquote></div><p>Замените строку<br /></p><div class="codebox"><pre><code>str=str+param</code></pre></div><p>на<br /></p><div class="codebox"><pre><code>str=str+cdate(param)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[omegastripes]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29228</uri>
			</author>
			<updated>2015-01-21T18:53:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90855#p90855</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: сложение времени]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=90848#p90848" />
			<content type="html"><![CDATA[<p>Хочу сделать скрипт для подсчета общей длительности видеофайлов в папке<br /></p><div class="codebox"><pre><code>

Option Explicit
Dim oFileDetailsReader, sTmpStr, sValue, i, input, output, objFSO, WSHShell, Folder, File, param, SubFolder, str
input = &quot;f:\видео\&quot;        
str=0
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set WSHShell = WScript.CreateObject(&quot;WScript.Shell&quot;)


RecursiveFolderScan input
 MsgBox str

&#039;Создаём процедуру рекурсивного обхода каталога
Sub RecursiveFolderScan(FolderPath)
    &#039;Получаем объектную модель текущего каталога
    Set Folder = objFSO.GetFolder(FolderPath)
 
    &#039;Перебираем все файлы в текущем каталоге
    For Each File in Folder.Files
Set oFileDetailsReader = New cFileDetailsReader
With oFileDetailsReader
    .OpenFile File
        param = .GetDetail(27)

 str=str+param
   End With
 Next
    &#039;Перебираем все подкаталоги в каталоге
    For Each SubFolder in Folder.SubFolders
        RecursiveFolderScan(SubFolder.Path)
    Next
Set WSHShell = Nothing

  End Sub



Set WSHShell = Nothing


Class cFileDetailsReader
    Private oFSO, oShellApp, oFolder3, oFolderItem
    
    Private Sub Class_Initialize()
        Set oFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
        Set oShellApp = CreateObject(&quot;Shell.Application&quot;)
    End Sub
    
    Sub OpenFile(FilePath)
        With oFSO.GetFile(FilePath)
            Set oFolder3 = oShellApp.NameSpace(.ParentFolder.Path)
            Set oFolderItem = oFolder3.ParseName(.Name)
        End With
    End Sub
    
    Function GetDetail(Index)
        GetDetail = oFolder3.GetDetailsOf(oFolderItem,Index)
    End Function

    Function GetDetailName(Index)
        GetDetailName = oFolder3.GetDetailsOf(0,Index)
    End Function
End Class</code></pre></div><p>но затык с сложением времени</p>]]></content>
			<author>
				<name><![CDATA[griha09]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27540</uri>
			</author>
			<updated>2015-01-21T10:26:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=90848#p90848</id>
		</entry>
</feed>
