<?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>MSFAQ.SE &#187; Script</title>
	<atom:link href="http://www.msfaq.se/category/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.msfaq.se</link>
	<description>System Management by Stefan Schörling</description>
	<lastBuildDate>Mon, 31 Oct 2011 20:26:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Script: Delete files older then x days.</title>
		<link>http://www.msfaq.se/2007/08/script-delete-files-older-then-x-days/</link>
		<comments>http://www.msfaq.se/2007/08/script-delete-files-older-then-x-days/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 15:06:36 +0000</pubDate>
		<dc:creator>stesch</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[Management]]></category>

		<guid isPermaLink="false">http://www.msfaq.se/?p=50</guid>
		<description><![CDATA[The other day I got a question if they could delete files in a folder older then 7 days automaticlly. I solved the question with a script and a scheduled task. And I thought id share the script with you. I would like to thank Fredrik Wall for script review. &#8216;This is a script to [...]]]></description>
			<content:encoded><![CDATA[<p>The other day  I got a question  if they could delete files in a folder older then 7 days automaticlly. I solved the question with a script and a scheduled task. And I thought id share the script with you.  I would like to thank <a href="http://www.fredrikwall.net" target="_blank">Fredrik Wall</a> for script review.</p>
<blockquote><p>&#8216;This is a script to delete files older then specified days</p>
<p>Option Explicit</p>
<p>Dim oFSO<br />
Dim sDirectoryPath<br />
Dim oFolder<br />
Dim oFileCollection<br />
Dim oFile<br />
Dim iDaysOld</p>
<p>&#8216;iDaysold = NumberofDays<br />
iDaysOld = 7</p>
<p>&#8216;sDirectoryPath = &#8220;Folder to deleteFiles in&#8221;<br />
sDirectoryPath = &#8220;C:Tempforanexample&#8221;</p>
<p>On Error Resume Next</p>
<p>Set oFSO = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br />
If objFSO.FolderExists(sDirectoryPath) Then<br />
Set oFolder = oFSO.GetFolder(sDirectoryPath)<br />
Set oFileCollection = oFolder.Files</p>
<p>For each oFile in oFileCollection<br />
If oFile.DateLastModified &lt; (Date() &#8211; iDaysOld) Then<br />
oFile.Delete(True)<br />
End If<br />
Next<br />
else<br />
WScript.Echo &#8220;No Folder&#8221;<br />
End If</p>
<p>Set oFSO = Nothing<br />
Set oFolder = Nothing<br />
Set oFileCollection = Nothing<br />
Set oFile = Nothing</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.msfaq.se/2007/08/script-delete-files-older-then-x-days/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change sms client cache location with a script</title>
		<link>http://www.msfaq.se/2007/07/change-sms-client-cache-location-with-a-script/</link>
		<comments>http://www.msfaq.se/2007/07/change-sms-client-cache-location-with-a-script/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 20:49:13 +0000</pubDate>
		<dc:creator>stesch</dc:creator>
				<category><![CDATA[Script]]></category>
		<category><![CDATA[SMS 2003]]></category>
		<category><![CDATA[ConfigMgr 2007]]></category>
		<category><![CDATA[Management]]></category>

		<guid isPermaLink="false">http://www.msfaq.se/?p=38</guid>
		<description><![CDATA[If you would like to change the location of  the client cache on your client you can do this with the following scipt. Where D: is where you want to set the cache location. Change for your own usage. On Error Resume Next Set oUIResource = CreateObject(&#8220;UIResource.UIResourceMgr&#8221;) Set objCacheInfo = oUIResource.GetCacheInfo nValueToSet = &#8220;D:&#8221; objCacheInfo.Location [...]]]></description>
			<content:encoded><![CDATA[<p>If you would like to change the location of  the client cache on your client you can do this with the following scipt. Where D: is where you want to set the cache location. Change for your own usage.</p>
<blockquote><p>On Error Resume Next<br />
Set oUIResource = CreateObject(&#8220;UIResource.UIResourceMgr&#8221;)<br />
Set objCacheInfo = oUIResource.GetCacheInfo<br />
nValueToSet = &#8220;D:&#8221;<br />
objCacheInfo.Location = nValueToSet</p></blockquote>
<p>Note: It will create a folder ccmcache under the folder you select. The folder does not need to exist but the drive needs to exist. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.msfaq.se/2007/07/change-sms-client-cache-location-with-a-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

