<?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>ben.hamilton.id.au &#187; How to</title>
	<atom:link href="http://ben.hamilton.id.au/category/how-to/feed" rel="self" type="application/rss+xml" />
	<link>http://ben.hamilton.id.au</link>
	<description>what I find interesting in tech and CRM</description>
	<lastBuildDate>Sun, 13 Nov 2011 21:37:11 +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>Excel Print Management</title>
		<link>http://ben.hamilton.id.au/how-to/excel-print-management?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=excel-print-management</link>
		<comments>http://ben.hamilton.id.au/how-to/excel-print-management#comments</comments>
		<pubDate>Wed, 05 Oct 2011 21:07:19 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=471</guid>
		<description><![CDATA[Over at Chandoo.org&#8217;s &#8220;Become AWESOME in Excel&#8221; blog, a great post on making the printing of reports from large Excel spreadsheets much easier: Printing multiple pages with different layouts using Excel. #]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>Over at Chandoo.org&#8217;s &#8220;Become AWESOME in Excel&#8221; blog, a great post on making the printing of reports from large Excel spreadsheets much easier: <a href="http://chandoo.org/wp/2011/09/14/hui%e2%80%99s-excel-report-printer/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+PointyHairedDilbert+%28Chandoo.org+-+Learn+Excel+%26+Charting+Online%29&amp;utm_content=Google+Reader">Printing multiple pages with different layouts using Excel</a>. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/excel-print-management#p0">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/how-to/excel-print-management/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Bootstrap</title>
		<link>http://ben.hamilton.id.au/how-to/twitter-bootstrap?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=twitter-bootstrap</link>
		<comments>http://ben.hamilton.id.au/how-to/twitter-bootstrap#comments</comments>
		<pubDate>Tue, 06 Sep 2011 21:52:28 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=441</guid>
		<description><![CDATA[This looks interesting: &#8220;Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites.It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.&#8221; via Bootstrap, from Twitter, via Scripting News. #]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>This looks interesting: &#8220;Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites.It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.&#8221; via <a href="http://twitter.github.com/bootstrap/">Bootstrap, from Twitter</a>, via <a href="http://scripting.com/stories/2011/09/06/twittersBootstrapToolkit.html">Scripting News</a>. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/twitter-bootstrap#p0">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/how-to/twitter-bootstrap/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Style Guide</title>
		<link>http://ben.hamilton.id.au/how-to/style-guide?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=style-guide</link>
		<comments>http://ben.hamilton.id.au/how-to/style-guide#comments</comments>
		<pubDate>Mon, 05 Sep 2011 21:42:27 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[style guide]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=438</guid>
		<description><![CDATA[What is a style guide? # A style guide or style manual is a set of standards for the writing and design of documents, either for general use or for a specific publication, organization or field. The implementation of a &#8230; <a href="http://ben.hamilton.id.au/how-to/style-guide">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>What is a style guide? <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/style-guide#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
A style guide or style manual is a set of standards for the writing and design of documents, either for general use or for a specific publication, organization or field. The implementation of a style guide provides uniformity in style and formatting of a document. See <a title="What is a style guide? (Wikipedia)" href="http://en.wikipedia.org/wiki/Style_guide">Wikipedia for more</a>. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/style-guide#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
<a title="Style Guide (A List Apart)" href="http://www.alistapart.com/contribute/styleguide/">A List Apart have a style guide</a> that I think is quite usable, such that I now loosely base our own style guide on it for an internal wiki that contains our procedures. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/style-guide#p2">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/how-to/style-guide/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Writing Answers</title>
		<link>http://ben.hamilton.id.au/how-to/writing-answers?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=writing-answers</link>
		<comments>http://ben.hamilton.id.au/how-to/writing-answers#comments</comments>
		<pubDate>Sun, 04 Sep 2011 08:07:19 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[answer]]></category>
		<category><![CDATA[question]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=414</guid>
		<description><![CDATA[Older post from Joe Chernov on how to write a great online answer (i.e. Quora). # I&#8217;ve printed out his post and stuck it to the wall here. The key points he makes are: # Be the first to answer. &#8230; <a href="http://ben.hamilton.id.au/how-to/writing-answers">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>Older post from <a href="http://www.jchernov.com/">Joe Chernov</a> on <a title="How to write an answer" href="http://darmano.typepad.com/logic_emotion/2011/03/answer.html">how to write a great online answer</a> (i.e. Quora). <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/writing-answers#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
I&#8217;ve printed out his post and stuck it to the wall here. The key points he makes are: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/writing-answers#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
<ol>
<li>Be the first to answer.</li>
<li>Include links and/or graphics in your answer.</li>
<li>Stick to a word count of 100 to 200 words.</li>
</ol>
<div>I like this because all to often we we need to answer a client or co-workers question, using his guidelines makes for a more succinet answer, which means it is more likely to be read, and in turn, acted upon.</div>
<div>But don&#8217;t take my word for it, <a title="How to write an answer" href="http://darmano.typepad.com/logic_emotion/2011/03/answer.html">go read his post and get it direct</a>.</div> <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/writing-answers#p2">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/how-to/writing-answers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find your external ip address from the command line</title>
		<link>http://ben.hamilton.id.au/microsoft/how-to-find-your-external-ip-address-from-the-command-line?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-find-your-external-ip-address-from-the-command-line</link>
		<comments>http://ben.hamilton.id.au/microsoft/how-to-find-your-external-ip-address-from-the-command-line#comments</comments>
		<pubDate>Wed, 31 Aug 2011 07:17:43 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=422</guid>
		<description><![CDATA[I often need to know what the external IP address for a client is. Thus I&#8217;ve cobbled together the following script. Simply copy the code below into externalip.cmd and when run from the command prompt it will do two things &#8230; <a href="http://ben.hamilton.id.au/microsoft/how-to-find-your-external-ip-address-from-the-command-line">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>I often need to know what the external IP address for a client is. Thus I&#8217;ve cobbled together the following script. Simply copy the code below into externalip.cmd and when run from the command prompt it will do two things for you: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/how-to-find-your-external-ip-address-from-the-command-line#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
<ol>
<li>the script will display the external IP address</li>
<li>the script will set the environment variable ExternalIP to be whatever that IP is</li>
</ol>
<code><br />
@echo off<br />
:: Find out what the External IP address is<br />
:: Create the .vbs file first<br />
Echo Option Explicit &gt;externalipaddress.vbs<br />
Echo Dim http : Set http = CreateObject( "MSXML2.ServerXmlHttp" ) &gt;&gt;externalipaddress.vbs<br />
Echo http.Open "GET", "http://whatismyip.org", False &gt;&gt;externalipaddress.vbs<br />
Echo http.Send &gt;&gt;externalipaddress.vbs<br />
Echo Wscript.Echo http.responseText &gt;&gt;externalipaddress.vbs<br />
Echo Set http = Nothing &gt;&gt;externalipaddress.vbs<br />
:: run the resulting .vbs script and set the enviroment variable<br />
for /f "skip=2 " %%G IN ('cscript externalipaddress.vbs') DO (Set ExternalIP=%%G)<br />
:: Display the enviroment variable<br />
Echo External IP is %ExternalIP%<br />
:: tidy up and remove the temp file<br />
del externalipaddress.vbs /q<br />
</code> <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/how-to-find-your-external-ip-address-from-the-command-line#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
<div>Let me know if you find this useful, or if you can improve on it I&#8217;d love to hear from you.</div> <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/how-to-find-your-external-ip-address-from-the-command-line#p2">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/microsoft/how-to-find-your-external-ip-address-from-the-command-line/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reading the Registry from the Command Line</title>
		<link>http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=reading-the-registry-from-the-command-line</link>
		<comments>http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line#comments</comments>
		<pubDate>Fri, 26 Aug 2011 12:03:45 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=411</guid>
		<description><![CDATA[Often I need to check windows registry values, for example, to see if an addon is working. # From the Microsoft Windows command line (Start &#124; run &#124; cmd) it is easy to see what value a registry key has: &#8230; <a href="http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>Often I need to check windows registry values, for example, to see if an addon is working. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
From the Microsoft Windows command line (Start | run | cmd) it is easy to see what value a registry key has: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
<code>REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\MS Project\Addins\Mindjet.Mm8MsProject.AddIn.4" /v "LoadBehavior"</code> <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line#p2">#</a><p class="winerlinks-enabled"><a name="p3"></a>
In this example above, we see if the Mindjet Mindmanager add-on is loaded or not in Microsoft Project. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line#p3">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/microsoft/reading-the-registry-from-the-command-line/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to clear the MS Exchange mail queue quickly</title>
		<link>http://ben.hamilton.id.au/microsoft/how-to-clear-the-ms-exchange-mail-queue-quickly?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-clear-the-ms-exchange-mail-queue-quickly</link>
		<comments>http://ben.hamilton.id.au/microsoft/how-to-clear-the-ms-exchange-mail-queue-quickly#comments</comments>
		<pubDate>Thu, 02 Dec 2010 06:41:43 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[SPAM]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=332</guid>
		<description><![CDATA[Spent the day dealing with an exchange server that had been compromised. As a result, heaps of spam emails were in the exchange mail queue. Manually removing them is a major pain in the rear. Fortunately, others have shared how &#8230; <a href="http://ben.hamilton.id.au/microsoft/how-to-clear-the-ms-exchange-mail-queue-quickly">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>Spent the day dealing with an exchange server that had been compromised. As a result, heaps of spam emails were in the exchange mail queue. Manually removing them is a major pain in the rear. Fortunately, others have shared <a title="Clear exchange mail queue of SPAM" href="http://technicians-blog.kingcomputer.com.au/how-to-clear-exchange-queue-when-there-are-hundres-of-spam-messages/">how to clear the Microsoft Exchange mail queue of thousands for spam mails</a>. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/how-to-clear-the-ms-exchange-mail-queue-quickly#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
<ol>
<li>Stop the SMTP service.</li>
<li>Create a new spam folder for example in<br />
C:\Program Files\Exchsrvr\Mailroot\vsi 1\Spam</li>
<li>With the SMTP service still stopped, move all the messages from the<br />
C:\Program Files\Exchsrvr\Mailroot\vsi 1\Queue<br />
to the spam folder (in case you need to retrieve a message)</li>
<li>Restart the SMTP service.</li>
</ol>
Of course prior to doing that, the instructions at this Microsoft KB <a title="MS KB on SMTP relay diagnosis" href="http://support.microsoft.com/kb/324958/">How to block open SMTP relaying and clean up Exchange Server SMTP queues in Windows Small Business Server</a> is quite helpful in showing how to make sure your exchange server is not an open relay. It also shows how to test if it is an authenticated relay attack that is the problem. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/how-to-clear-the-ms-exchange-mail-queue-quickly#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<h1 class="title">How to block open SMTP relaying and clean up Exchange  Server SMTP queues in Windows Small Business Server</h1>
</div> <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/how-to-clear-the-ms-exchange-mail-queue-quickly#p2">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/microsoft/how-to-clear-the-ms-exchange-mail-queue-quickly/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using registry values in scripts</title>
		<link>http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-registry-values-in-scripts</link>
		<comments>http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#comments</comments>
		<pubDate>Sun, 22 Aug 2010 11:30:10 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=265</guid>
		<description><![CDATA[I&#8217;m often writing scripts to do stuff. It makes my job easier. I&#8217;ve often wanted to be able to script the discovery of registry values in the Windows Registry. # Thus here is a short example on using the vanilla &#8230; <a href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>I&#8217;m often writing scripts to do stuff. It makes my job easier. I&#8217;ve often wanted to be able to script the discovery of registry values in the Windows Registry. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
Thus here is a short example on using the vanilla windows command line to find the value of a Windows registry key. From my testing these commands are all present by default in Windows XP, Vista, 7, Server 2003 and Server 2008. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
Assume we want to find the Microsoft Windows Common Files directory. Using `Regedit` we can find that here: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CommonFilesDir` <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p2">#</a><p class="winerlinks-enabled"><a name="p3"></a>
So the first thing we want to do is query the registry, we do that with the command line tool `reg` as follows ([more about reg][]): <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p3">#</a><p class="winerlinks-enabled"><a name="p4"></a>
[more about reg]:http://www.petri.co.il/reg_command_in_windows_xp.htm<br />
&#8220;Read up on how to use the reg command for more than just a query&#8221; <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p4">#</a><p class="winerlinks-enabled"><a name="p5"></a>
`reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v CommonFilesDir >1.tmp` <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p5">#</a><p class="winerlinks-enabled"><a name="p6"></a>
This will spit out the following into the text file `1.tmp`: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p6">#</a><p class="winerlinks-enabled"><a name="p7"></a>
&#8212; <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p7">#</a><p class="winerlinks-enabled"><a name="p8"></a>
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion<br />
    CommonFilesDir    REG_SZ    C:\Program Files\Common Files <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p8">#</a><p class="winerlinks-enabled"><a name="p9"></a>
&#8212; <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p9">#</a><p class="winerlinks-enabled"><a name="p10"></a>
However, this isn&#8217;t of much use in a script. Really, we just want the value of the folder itself, not all the extra info. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p10">#</a><p class="winerlinks-enabled"><a name="p11"></a>
So what we do is use the command line tool &#8216;findstr&#8217; which essentially is a windows regex tool ([more about findstr][]). We use it to do this: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p11">#</a><p class="winerlinks-enabled"><a name="p12"></a>
[more about findstr]:http://www.netexpertise.eu/en/windows/findstr-an-alternative-to-grep.html<br />
&#8220;Read up on findstr &#8211; regex goodness on windows by default&#8221; <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p12">#</a><p class="winerlinks-enabled"><a name="p13"></a>
`findstr /r REG_SZ 1.tmp >2.tmp` <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p13">#</a><p class="winerlinks-enabled"><a name="p14"></a>
This spits out just the line that contains REG_SZ and puts it into the text file `2.tmp`. Now that we&#8217;ve just just the one line, we want to strip the first 32 characters off it. We do this by first setting it as an enviroment variale and then trimming it down using the following two commands ([more on set][]): <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p14">#</a><p class="winerlinks-enabled"><a name="p15"></a>
[more on set]:http://www.computing.net/answers/windows-2000/use-file-contents-to-set-variables/63174.html<br />
&#8220;Using file contents to set enviroment variables&#8221; <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p15">#</a><p class="winerlinks-enabled"><a name="p16"></a>
`set /p CommFiles=<2.tmp` <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p16">#</a><p class="winerlinks-enabled"><a name="p17"></a>
And then we shorten that ([more on trimming][]): <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p17">#</a><p class="winerlinks-enabled"><a name="p18"></a>
[more on trimming]:http://www.dostips.com/DtTipsStringManipulation.php<br />
"Read up on using set to trim environment variables" <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p18">#</a><p class="winerlinks-enabled"><a name="p19"></a>
`set CommFiles=%CommFiles:~32%` <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p19">#</a><p class="winerlinks-enabled"><a name="p20"></a>
Then we can echo the result to the screen using: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p20">#</a><p class="winerlinks-enabled"><a name="p21"></a>
`Echo The Common Files directory is: %CommFiles%` <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p21">#</a><p class="winerlinks-enabled"><a name="p22"></a>
And here it is all in one easy to copy set: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p22">#</a><p class="winerlinks-enabled"><a name="p23"></a>
--- <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p23">#</a><p class="winerlinks-enabled"><a name="p24"></a>
    Set CommFiles=C:\Temp<br />
    reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion /v CommonFilesDir >1.tmp<br />
    findstr /r REG_SZ 1.tmp >2.tmp<br />
    set /p CommFiles=<2.tmp<br />
    set CommFiles=%CommFiles:~32%<br />
    Echo The Common Files directory is: %CommFiles% <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p24">#</a><p class="winerlinks-enabled"><a name="p25"></a>
&#8212; <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p25">#</a><p class="winerlinks-enabled"><a name="p26"></a>
With a little editing I&#8217;m sure that you can turn this to your own uses, pulling out the value of registry keys and using them in script files. You&#8217;re not limited to this registry key, you can use it to access all sorts of registry keys. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p26">#</a><p class="winerlinks-enabled"><a name="p27"></a>
Please do tell me what uses you put this to. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p27">#</a><p class="winerlinks-enabled"><a name="p28"></a>
Enjoy. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts#p28">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/microsoft/using-registry-values-in-scripts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up WriteMonkey on WordPress</title>
		<link>http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-writemonkey-on-wordpress</link>
		<comments>http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#comments</comments>
		<pubDate>Sun, 25 Jul 2010 12:15:03 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Markdown]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WriteMonkey]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=235</guid>
		<description><![CDATA[This post has been written using [WriteMonkey](http://writemonkey.com/ &#8220;Zenware for full screen distraction free writing&#8221;) as the text editor. Not only that but I&#8217;ve utilised Markdown as the method of text mark-up. All of this has been achieved using WordPress as &#8230; <a href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>This post has been written using [WriteMonkey](http://writemonkey.com/ &#8220;Zenware for full screen distraction free writing&#8221;) as the text editor. Not only that but I&#8217;ve utilised Markdown as the method of text mark-up. All of this has been achieved using WordPress as my CMS, Firefox as my browser and a Firefox plug-in called It&#8217;s All Text. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
My first impressions are actually good. Although its taken a little setup, I&#8217;m actually happy with the result. You see, using WriteMonkey as a text editor is, well, gorgeous. The screen is emptied of all distractions. With typewriter mode enabled, it is a pure joy to use. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
Now to get this to work I did the following: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p2">#</a><p class="winerlinks-enabled"><a name="p3"></a>
+ [disabled the visual editor](http://digwp.com/2010/06/blogging-in-markdown/ &#8220;Article by Chris Coyier on blogging in WordPress with Markdown&#8221;) in [WordPress](http://wordpress.org &#8220;The official WordPress site&#8221;),<br />
+ installed the [It's All Text](https://addons.mozilla.org/en-US/firefox/addon/4125/contribute/roadblock/?src=addondetail &#8220;Firefox add-on page for It&#8217;s All Text&#8221;) Firefox plug-in,<br />
+ installed the [PHP Markdown](http://michelf.com/projects/php-markdown/ &#8220;Download page for PHP Markdown&#8221;) [plug-in for WordPress](http://wordpress.org/support/topic/160189 &#8220;Help getting Markdown working in WordPress&#8221;),<br />
+ started writing :) <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p3">#</a><p class="winerlinks-enabled"><a name="p4"></a>
Not so hard is it? Actually the writing bit is the hardest. But you knew that&#8230; <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p4">#</a><p class="winerlinks-enabled"><a name="p5"></a>
What it now means is that when I begin writing a new post in WordPress, I simple click the little edit button that appears, and WriteMonkey fires up, comes to the foreground and I start writing. To finish up, I press CTRL-Q and I click YES I do want to save it. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p5">#</a><p class="winerlinks-enabled"><a name="p6"></a>
So I can whole-heartedly say that it&#8217;s worth the effort to setup [WriteMonkey](http://writemonkey.com/ &#8220;Zenware for full screen distraction free writing&#8221;). Go do it! It feels good. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p6">#</a><p class="winerlinks-enabled"><a name="p7"></a>
Of course, now the hard bit is about to start, that is, do more writing. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p7">#</a><p class="winerlinks-enabled"><a name="p8"></a>
PS: Only found out about WriteMonkey via [DownloadSquad](http://www.downloadsquad.com/2010/07/23/writemonkey-0-9-9-0-final-version-released-full-screen-text-lov/ &#8220;These guys are on the bleeding edge of shiny&#8221;) <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress#p8">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/how-to/setting-up-writemonkey-on-wordpress/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to: Clear Outlook Location list</title>
		<link>http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-clear-outlook-location-list</link>
		<comments>http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#comments</comments>
		<pubDate>Thu, 22 Jul 2010 22:38:36 +0000</pubDate>
		<dc:creator>Ben Hamilton</dc:creator>
				<category><![CDATA[How to]]></category>
		<category><![CDATA[2007]]></category>
		<category><![CDATA[ACT!]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Outlook]]></category>

		<guid isPermaLink="false">http://ben.hamilton.id.au/?p=230</guid>
		<description><![CDATA[Had an issue yesterday where we wanted to remove some entires from Outlooks location list. # Huh? When you book an appointment in Microsoft Outlooks calendar you can specify a location. If ACT! by Sage has a Resource that is &#8230; <a href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p class="winerlinks-enabled"><a name="p0"></a>Had an issue yesterday where we wanted to remove some entires from Outlooks location list. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p0">#</a><p class="winerlinks-enabled"><a name="p1"></a>
Huh? When you book an appointment in Microsoft Outlooks calendar you can specify a location. If ACT! by Sage has a Resource that is designated as a location, when ACT! sync&#8217;s with Outlook that location list gets filled in. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p1">#</a><p class="winerlinks-enabled"><a name="p2"></a>
So, we wanted to edit that list in Outlook. Well, you can&#8217;t. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p2">#</a><p class="winerlinks-enabled"><a name="p3"></a>
But you can clear the list completely, which for our purpose suited us fine, it&#8217;ll get repopulated with the correct values. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p3">#</a><p class="winerlinks-enabled"><a name="p4"></a>
Thus, without further ado, here is how you do this: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p4">#</a><p class="winerlinks-enabled"><a name="p5"></a>
Open up Regedit and remove the value from this key: <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p5">#</a><p class="winerlinks-enabled"><a name="p6"></a>
<pre><code>HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Preferences\LocationMRU
</code></pre>
Note that you will need to replace the version number for your version of Microsoft Office (14.0 = MSO2010, 12.0 = MSO2007). <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p6">#</a><p class="winerlinks-enabled"><a name="p7"></a>
Hat tip to <a title="superuser - delete locations from Outlook" href="http://superuser.com/questions/41242/how-to-delete-locations-from-the-location-history-when-creating-a-new-appointment">superuser.com</a>. <a ref="permalink" title="Permalink to this paragraph" class="winerlink" href="http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list#p7">#</a>]]></content:encoded>
			<wfw:commentRss>http://ben.hamilton.id.au/how-to/how-to-clear-outlook-location-list/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

