<?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=6143&amp;type=atom" />
	<updated>2011-09-22T13:44:40Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6143</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51744#p51744" />
			<content type="html"><![CDATA[<p><strong>Jango</strong>, приведите код создания и проверки. И что значит:<br /></p><div class="quotebox"><blockquote><p>при проверке выдаёт что не поддерживается DateLastModified</p></blockquote></div><p>Если это ошибка, то: <a href="http://forum.script-coding.com/rules.html#4.12.">#4.12</a>.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-09-22T13:44:40Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51744#p51744</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51743#p51743" />
			<content type="html"><![CDATA[<p>создаю файл </p><div class="codebox"><pre><code> Set signalFile = objFSO.CreateTextFile(&quot;C:\newfiles\sf.txt&quot;)</code></pre></div><p>но потом при проверке выдаёт что не поддерживается DateLastModified</p>]]></content>
			<author>
				<name><![CDATA[Jango]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27152</uri>
			</author>
			<updated>2011-09-22T13:34:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51743#p51743</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51742#p51742" />
			<content type="html"><![CDATA[<p>Создавайте флаговый файл и ищите файлы, время создания/модификации которых позднее даты создания флагового файла.</p>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24846</uri>
			</author>
			<updated>2011-09-22T11:50:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51742#p51742</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51741#p51741" />
			<content type="html"><![CDATA[<p>Что-то вроде: проверил скрипт папки и записал куда-нибудь список файлов с датами изменения, потом на следующий запуск сверился с этим списком и сообщил, были ли изменения.</p>]]></content>
			<author>
				<name><![CDATA[Jango]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27152</uri>
			</author>
			<updated>2011-09-22T11:35:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51741#p51741</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51738#p51738" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Jango пишет:</cite><blockquote><p>Как бы теперь прикрутить проверку с последнего запуска скрипта...</p></blockquote></div><p>Поясните.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-09-22T10:41:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51738#p51738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=51734#p51734" />
			<content type="html"><![CDATA[<p>Как бы теперь прикрутить проверку с последнего запуска скрипта...</p>]]></content>
			<author>
				<name><![CDATA[Jango]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27152</uri>
			</author>
			<updated>2011-09-22T08:06:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=51734#p51734</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50986#p50986" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>alexii пишет:</cite><blockquote><p><strong>Jango</strong>, зачем «.ShortName»?</p></blockquote></div><p>Ага, это я уже понял и поменял на просто .Name</p>]]></content>
			<author>
				<name><![CDATA[Jango]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27152</uri>
			</author>
			<updated>2011-08-31T11:10:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50986#p50986</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50975#p50975" />
			<content type="html"><![CDATA[<p><strong>Jango</strong>, зачем «.ShortName»?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-08-31T03:45:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50975#p50975</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50952#p50952" />
			<content type="html"><![CDATA[<p>Собрал скрипт, создающий ярлыки на изменившиеся файлы за сутки:</p><div class="codebox"><pre><code>Dim strFolder, dstFolder, File, objFSO, objFolder, WSHShell
  
 strFolder = &quot;S:\sheff&quot;
 dstFolder = &quot;C:\newfiles&quot;
  
 Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)
 Set WSHShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
 Set objFolder = objFSO.GetFolder(strFolder) 
 Set colFiles = objFolder.Files 
 For Each objFile In colFiles 
   File = objFile.ShortName 
   Doit File 
 Next 
  
 ShowSubFolders(objFolder) 
 Sub ShowSubFolders(objFolder) 
   Set colFolders = objFolder.SubFolders 
   For Each objSubFolder In colFolders 
        Set colFiles = objSubFolder.Files 
     For Each objFile In colFiles 
         File = objFile.ShortName 
             Doit File 
     Next 
    ShowSubFolders(objSubFolder) 
   Next 
 End Sub 
  
 Function Doit(File)
     If (Now - objFile.DateLastModified) &lt; 2 Then
              Set MyShortcut = WSHShell.CreateShortcut(dstFolder &amp; &quot;\&quot; &amp; File &amp; &quot;.lnk&quot;)
              MyShortcut.TargetPath = objFile
              MyShortcut.WorkingDirectory = objFolder
              MyShortcut.WindowStyle = 4
              MyShortcut.Save
     End If
 End Function</code></pre></div><p>но<br />он выдает ошибку после всех действий и имена ярлыков получаются кракозябрами</p><p>UPD: с ошибкой разобрался, теперь нужно разобраться с именем ярлыка, как-то иначе получать имя файла в File здесь Set MyShortcut = WSHShell.CreateShortcut(dstFolder &amp; &quot;\&quot; &amp; File &amp; &quot;.lnk&quot;)</p>]]></content>
			<author>
				<name><![CDATA[Jango]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27152</uri>
			</author>
			<updated>2011-08-30T07:23:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50952#p50952</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50796#p50796" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Jango пишет:</cite><blockquote><p>Всем привет.<br />Такая задача:</p></blockquote></div><p>Курите FileSystemObject.<br />Таким образом:<br /></p><div class="codebox"><pre><code>Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
startFolder = &quot;Z:\temp\&quot; &#039; Ваш каталог
OlderThanDate = DateAdd(&quot;d&quot;, -7, Date) &#039; дата, старше которой необходимо удалять
If fso.FolderExists (startFolder) Then DeleteOldFiles startFolder, OlderThanDate
 
Function DeleteOldFiles(folderName, BeforeDate)
    Dim folder, file, fileCollection, folderCollection, subFolder    
    Set folder = fso.GetFolder(folderName)
    Set fileCollection = folder.Files
    For Each file In fileCollection
        If file.DateLastModified &lt; BeforeDate Then
            fso.DeleteFile file.Path, True
        End If
    Next 
    Set folderCollection = folder.SubFolders
    For Each subFolder In folderCollection
       DeleteOldFiles subFolder.Path, BeforeDate
       If subFolder.Size = 0 Then subFolder.Delete True
    Next
End Function</code></pre></div><p>удалял файлы старше 7 дней из темпового каталога на серваке. <br />Отсюда можно слепить решение Вашей задачи.</p>]]></content>
			<author>
				<name><![CDATA[dab00]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27085</uri>
			</author>
			<updated>2011-08-22T10:29:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50796#p50796</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: обход папок с выводом сообщения о новых файлах]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=50795#p50795" />
			<content type="html"><![CDATA[<p>Всем привет.<br />Такая задача: есть каталог с подкаталогами, вложенностью до 10, нужно сделать обход по всем каталогам-подкаталогам с выводом списка новых/изменившихся файлов или выводом ярлыков этих файлов в папку на рабочем столе.<br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Jango]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27152</uri>
			</author>
			<updated>2011-08-22T10:02:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=50795#p50795</id>
		</entry>
</feed>
