<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wayne Zimmerman&#039;s Blog &#187; Temporary Internet Files</title>
	<atom:link href="http://www.waynezim.com/tag/temporary-internet-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.waynezim.com</link>
	<description>My World of Tech, Life and Anything Else</description>
	<lastBuildDate>Thu, 11 Mar 2010 05:02:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remove Temporary Files at Logoff</title>
		<link>http://www.waynezim.com/2009/04/remove-temporary-files-at-logoff/</link>
		<comments>http://www.waynezim.com/2009/04/remove-temporary-files-at-logoff/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 19:17:02 +0000</pubDate>
		<dc:creator>Wayne Zimmerman</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Domain]]></category>
		<category><![CDATA[Group Policy]]></category>
		<category><![CDATA[Logoff]]></category>
		<category><![CDATA[Temp]]></category>
		<category><![CDATA[Temp Files]]></category>
		<category><![CDATA[Temporary Files]]></category>
		<category><![CDATA[Temporary Internet Files]]></category>
		<category><![CDATA[User Accounts]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[VBscript]]></category>

		<guid isPermaLink="false">http://www.waynezim.com/?p=55</guid>
		<description><![CDATA[Over time users tend to open a lot of items programs that write little files to be used just once to print a document or a small setting for a program. These items build up over time and cause your computer to run slower due to your antivirus solution scanning it, your hard drive taking [...]]]></description>
			<content:encoded><![CDATA[<p>Over time users tend to open a lot of items programs that write little files to be used just once to print a document or a small setting for a program. These items build up over time and cause your computer to run slower due to your antivirus solution scanning it, your hard drive taking longer to find a free space of disk to write your new file or has to spend more time gathering up fragments of your file from in between these temp files. The solution here is pretty simple, these files need to go, and probably the easiest solution is the remove them when the user logs off. This doesn&#8217;t require anymore time for the user and typically isn&#8217;t a problem since most computers are logged on and off once a day.
<p>This script will remove the most common temporary folder for the user as well as remove any of the temporary internet files that they have gathered while surfing the web. When we implemented this script we noticed that the antivirus scan time and how many files it scanned were significantly reduced providing a better and faster workstation for your users. This script should be placed in the Group Policy for users as one of their logoff script.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left2">Download <a href="http://www.waynezim.com/wp-content/plugins/wp-codebox/wp-codebox.php?p=55&amp;download=cleantemp.vbs">cleantemp.vbs</a></span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p552"><td class="code" id="p55code2"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Const</span> TEMPORARY_INTERNET_FILES = &amp;H20&amp;
<span style="color: #000080;">dim</span> intDepth
&nbsp;
<span style="color: #000080;">Set</span> objShell = CreateObject(<span style="color: #800000;">&quot;Shell.Application&quot;</span>)
<span style="color: #000080;">Set</span> objFSO = CreateObject(<span style="color: #800000;">&quot;Scripting.FileSystemObject&quot;</span>)
&nbsp;
<span style="color: #008000;">'Clean User Temporary Intenet Files
</span><span style="color: #000080;">Set</span> objNameSpace = objShell.Namespace(TEMPORARY_INTERNET_FILES)
<span style="color: #000080;">Set</span> objFolderItem = objNameSpace.Self
<span style="color: #000080;">set</span> objFolder=objFSO.GetFolder(objFolderItem.Path)
intDepth=0
RemoveFolder objFolder
&nbsp;
<span style="color: #008000;">'Clean User Temp Files
</span><span style="color: #000080;">Const</span> TemporaryFolder = 2
<span style="color: #000080;">Set</span> tempFolder = objFSO.GetSpecialFolder(TemporaryFolder)
RemoveFolder tempFolder
&nbsp;
&nbsp;
<span style="color: #000080;">sub</span> RemoveFolder(objFolder)
	<span style="color: #008000;">' Recursively remove files and folders
</span>	intDepth=intDepth+1
	<span style="color: #000080;">on</span> <span style="color: #000080;">error</span> <span style="color: #000080;">resume</span> <span style="color: #000080;">next</span>
	<span style="color: #000080;">for</span> <span style="color: #000080;">each</span> objFile <span style="color: #000080;">in</span> objFolder.Files
		objFile.Delete <span style="color: #000080;">true</span>
	<span style="color: #000080;">next</span>
	Err.Clear
	<span style="color: #000080;">on</span> <span style="color: #000080;">error</span> <span style="color: #000080;">goto</span> 0
	<span style="color: #000080;">for</span> <span style="color: #000080;">each</span> objSubfolder <span style="color: #000080;">in</span> objFolder.SubFolders
		RemoveFolder objSubFolder
	<span style="color: #000080;">next</span>
	intDepth=intDepth-1
	<span style="color: #000080;">if</span> intDepth&lt;&gt;0 <span style="color: #000080;">then</span><span style="color: #008000;">' Don't delete top-level folder
</span>		<span style="color: #000080;">on</span> <span style="color: #000080;">error</span> <span style="color: #000080;">resume</span> <span style="color: #000080;">next</span>
		objFolder.Delete <span style="color: #000080;">true</span> 
		err.Clear
		<span style="color: #000080;">on</span> <span style="color: #000080;">error</span> <span style="color: #000080;">goto</span> 0
	<span style="color: #000080;">end</span> <span style="color: #000080;">if</span>
<span style="color: #000080;">end</span> <span style="color: #000080;">sub</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.waynezim.com/2009/04/remove-temporary-files-at-logoff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
