{"id":1277,"date":"2011-01-02T10:11:47","date_gmt":"2011-01-02T10:11:47","guid":{"rendered":"https:\/\/www.buarotti.ch\/?p=1277"},"modified":"2012-01-21T10:13:52","modified_gmt":"2012-01-21T10:13:52","slug":"timer-script-vbs","status":"publish","type":"post","link":"https:\/\/www.buarotti.ch\/?p=1277","title":{"rendered":"Timer Script &#8211; VBS"},"content":{"rendered":"<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n' ###################################################\r\n ' File: Timer.vbs\r\n ' Author: M.Buarotti\r\n ' Description: Script welches Aufgaben erledigt in der\r\n ' definierten Zeit.\r\n ' Date: 26.01.2008 Version: 1.1\r\n ' ###################################################\r\n\r\n Const EVENTLOG_SUCCESS = 0\r\n Const EVENTLOG_ERR_TYPE = 1\r\n Const EVENTLOG_WARN_TYPE = 2\r\n Const EVENTLOG_INFO_TYPE = 4\r\n\r\n Set objShell = CreateObject(&quot;wscript.shell&quot;)\r\n\r\n objTime()\r\n Function objTime\r\n Do\r\n ' FormatDateTime formatiert die Zeit\r\n objTime = FormatDateTime(Time, 4)\r\n Wscript.echo objTime\r\n\r\n sTime = &quot;11:15&quot;\r\n eTime = &quot;11:40&quot;\r\n\r\n If objtime&gt;(sTime) then\r\n If objtime&lt;(eTime) then\r\n ' ## Funktion jobRun wird aufgerufen.\r\n jobRun()\r\n Else\r\n ' ## Funktion jobNotRun wird aufgerufen.\r\n jobNotRun()\r\n End If\r\n End If\r\n Wscript.Sleep 10000\r\n Loop\r\n End Function\r\n\r\n ' ## Funktion wenn der Job gestartet wirklich gestartet wird.\r\n Function jobRun\r\n wscript.echo &quot;Ich darf starten..&quot; &amp; oTime\r\n objShell.LogEvent EVENTLOG_INFO_TYPE, &quot;Job Running --&gt; &quot; &amp; Time\r\n End Function\r\n\r\n ' ## Funktion wenn der Job nicht gestartet werden soll\r\n Function jobNotRun\r\n wscript.echo &quot;Ich darf nicht starten..&quot; &amp; oTime\r\n objShell.LogEvent EVENTLOG_WARN_TYPE, &quot;Job not Running --&gt; &quot; &amp; Time\r\n End Function\r\n <\/pre>\n<h3>Related Images:<\/h3>","protected":false},"excerpt":{"rendered":"<p>&#8218; ################################################### &#8218; File: Timer.vbs &#8218; Author: M.Buarotti &#8218; Description: Script welches Aufgaben erledigt in der &#8218; definierten Zeit. &#8218; Date: 26.01.2008 Version: 1.1 &#8218; ################################################### Const EVENTLOG_SUCCESS = 0 Const EVENTLOG_ERR_TYPE = 1 Const EVENTLOG_WARN_TYPE = 2 Const EVENTLOG_INFO_TYPE = 4 Set objShell = CreateObject(&quot;wscript.shell&quot;) objTime() Function objTime Do &#8218; FormatDateTime formatiert die Zeit [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1277","post","type-post","status-publish","format-standard","hentry","category-vbscript"],"_links":{"self":[{"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=\/wp\/v2\/posts\/1277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1277"}],"version-history":[{"count":1,"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=\/wp\/v2\/posts\/1277\/revisions"}],"predecessor-version":[{"id":1278,"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=\/wp\/v2\/posts\/1277\/revisions\/1278"}],"wp:attachment":[{"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.buarotti.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}