<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBS: ограничение времени работы скрипта]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=11230</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11230&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBS: ограничение времени работы скрипта».]]></description>
		<lastBuildDate>Sat, 16 Jan 2016 20:52:06 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: VBS: ограничение времени работы скрипта]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=100398#p100398</link>
			<description><![CDATA[<p>По логике весь скрипт - это Obrabotka input, запуски которого пишутся в планировщик.</p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Sat, 16 Jan 2016 20:52:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=100398#p100398</guid>
		</item>
		<item>
			<title><![CDATA[VBS: ограничение времени работы скрипта]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=100397#p100397</link>
			<description><![CDATA[<p>Сделал себе маленький скрипт чтоб запускал команды обработки в пятницу после 21-00, а останавливался в понедельник после 10-00. Все работает, просто подумал может старожилы предложат конструкцию по-красивее.</p><div class="codebox"><pre><code>input = &quot;e:\input\&quot;			&#039;папка input
Set objFSO = CreateObject(&quot;Scripting.FileSystemObject&quot;)

While true
Vizov
Wend


Sub Obrabotka(FolderPath)
    &#039;Получаем объектную модель текущего каталога
    Set Folder = objFSO.GetFolder(FolderPath)
 
    &#039;Перебираем все файлы в текущем каталоге
    For Each File in Folder.Files
	
&#039;команды обработки


	If Weekday(date, 0) =1 And Hour(time) =&gt; 10 Then  Vizov  &#039;прекращаем обработку в понедельник в 10-00

    Next
 End Sub


Sub Vizov
If Weekday(date, 0) =5 And Hour(time) =&gt; 21 Then    &#039;начинаем обработку в пятн в 21-00
Obrabotka input
 Else
    WScript.Sleep 1800000   &#039;спим 30 минут
End If
End Sub</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (griha09)]]></author>
			<pubDate>Sat, 16 Jan 2016 20:32:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=100397#p100397</guid>
		</item>
	</channel>
</rss>
