<?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=13209&amp;type=atom" />
	<updated>2017-11-17T06:15:43Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=13209</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS: переменные, очистка каталога]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121278#p121278" />
			<content type="html"><![CDATA[<p>Спасибо.<br />итоговый результат выглядит так:</p><div class="codebox"><pre><code>On Error Resume Next
Set objShell = CreateObject( &quot;WScript.Shell&quot; )
userway = objShell.ExpandEnvironmentStrings(&quot;%APPDATA%&quot;)
userway = userway + &quot;\Microsoft\Signatures&quot;
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
Set objFSO = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objFolder = objFSO.GetFolder(userway)
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
errResults = objSubfolder.Delete
Next
Set files_col = objFolder.files
For each file_obj in files_col
file_obj.delete(true)
Next</code></pre></div>]]></content>
			<author>
				<name><![CDATA[s.makhotkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38882</uri>
			</author>
			<updated>2017-11-17T06:15:43Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121278#p121278</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS: переменные, очистка каталога]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121261#p121261" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Set objShell = CreateObject( &quot;WScript.Shell&quot; )
appDataLocation=objShell.ExpandEnvironmentStrings(&quot;%APPDATA%&quot;)
WScript.Echo appDataLocation</code></pre></div>]]></content>
			<author>
				<name><![CDATA[929151]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=29475</uri>
			</author>
			<updated>2017-11-16T10:51:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121261#p121261</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS: переменные, очистка каталога]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=121251#p121251" />
			<content type="html"><![CDATA[<p>прошу помощи в поиске правильного ответа.<br />нужно скриптом полностью очищать каталог<br />%AppData%\Microsoft\Signatures</p><br /><div class="codebox"><pre><code>On Error Resume Next
Set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
Set objFSO = WScript.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objFolder = objFSO.GetFolder(&quot;%AppData%&quot; &amp; “\Roaming\Microsoft\Signatures”)
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
errResults = objSubfolder.Delete
Next
Set files_col = objFolder.files
For each file_obj in files_col
file_obj.delete(true)
Next
</code></pre></div><p>указать полный путь до папки не вариант, т.к. на разных ОС он разный</p>]]></content>
			<author>
				<name><![CDATA[s.makhotkin]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=38882</uri>
			</author>
			<updated>2017-11-16T08:23:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=121251#p121251</id>
		</entry>
</feed>
