<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: удаление папок +1 от указанного корня]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6546&amp;type=atom" />
	<updated>2011-12-16T09:25:55Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6546</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: удаление папок +1 от указанного корня]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54692#p54692" />
			<content type="html"><![CDATA[<p>Ну и в чем проблема? Пользуйтесь поиском по форуму, найдите как получать дочерние папки указанной директории, а дальше примените указанный выше скрипт.</p><p>Просто задача тривиальна, да и непонятно, что Вы сделали для ее решения.</p>]]></content>
			<author>
				<name><![CDATA[JSmаn]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24434</uri>
			</author>
			<updated>2011-12-16T09:25:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54692#p54692</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: удаление папок +1 от указанного корня]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54673#p54673" />
			<content type="html"><![CDATA[<p>Что совсем ни кто не чего не знает?</p><p>МОжет есть другой скрипт? другой способ?</p><p>ну должно же быть какое то решение?</p>]]></content>
			<author>
				<name><![CDATA[nikit0ss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27424</uri>
			</author>
			<updated>2011-12-15T19:12:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54673#p54673</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBScript: удаление папок +1 от указанного корня]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54550#p54550" />
			<content type="html"><![CDATA[<p>Здравствуйте уважаемые знающие люди. В интернете много скриптов по удалению файлов по истечении времени, но там нет важной для меня функции.</p><p><span style="color: Green"><strong>Е</strong></span>сть место, расположенное в сети, либо же можно физически на сервере, папка SCAN, в этой папке находятся еще много папок - по &quot;логину в винде юзера&quot;<span style="color: Green"><strong>.</strong></span><br />Есть такой скрипт, который удаляет файлы страше 2_х дней в папке, нужно добавить в него в папке +1</p><p><span style="color: Green"><strong>Т</strong></span>.е. чтобы удаление происходило не в path = &quot;C:\Temp&quot; а ВНУТРИ директорий находящихся в этой папке.</p><p><span style="color: Green"><strong>Н</strong></span>апример &quot;C:\Temp\Sidorov&quot;,&nbsp; &quot;C:\Temp\Petrov&quot;,&nbsp; &quot;C:\Temp\Ivanov&quot;<br /></p><div class="codebox"><pre><code>path = &quot;C:\Temp&quot;
killdate = date() - 7
arFiles = Array()
set fso = createobject(«scripting.filesystemobject»)

SelectFiles path, killdate, arFiles, truenDeleted = 0
for n = 0 to ubound(arFiles)
on error resume next
arFiles(n).delete true
if err.number &lt;&gt; 0 then
wscript.echo &quot;Unable to delete: &quot; &amp; arFiles(n).path
else
nDeleted = nDeleted + 1
end if
on error goto 0
next

msgbox nDeleted &amp; &quot; of &quot; &amp; ubound(arFiles)+1 _
&amp; &quot; eligible files were deleted&quot;

sub SelectFiles(sPath,vKillDate,arFilesToKill,bIncludeSubFolders)
on error resume next
set folder = fso.getfolder(sPath)
set files = folder.files

for each file in files
dtlastmodified = null
on error resume Next
dtlastmodified = file.datelastmodified
on error goto 0
if not isnull(dtlastmodified) Then
if dtlastmodified &lt; vKillDate then
count = ubound(arFilesToKill) + 1
redim preserve arFilesToKill(count)
set arFilesToKill(count) = file
end if
end if
next

if bIncludeSubFolders then
for each fldr in folder.subfolders
SelectFiles fldr.path,vKillDate,arFilesToKill,true
next
end if
end sub</code></pre></div>]]></content>
			<author>
				<name><![CDATA[nikit0ss]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27424</uri>
			</author>
			<updated>2011-12-13T09:46:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54550#p54550</id>
		</entry>
</feed>
