<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Duncan Smart's Weblog</title>
	<atom:link href="http://blog.dotsmart.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dotsmart.net</link>
	<description>insert witty, geeky tagline here...</description>
	<lastBuildDate>Wed, 24 Jun 2009 13:27:50 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
		<url>http://www.gravatar.com/blavatar/b1764b0fee8b6fef8b7e3a89aca10244?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Duncan Smart's Weblog</title>
		<link>http://blog.dotsmart.net</link>
	</image>
			<item>
		<title>Using Windows 7&#8217;s &#8220;XP Mode&#8221; to run IE 6, IE 7 and IE8 side-by-side</title>
		<link>http://blog.dotsmart.net/2009/06/24/using-windows-7s-xp-mode-to-run-ie-6-and-ie-7-side-by-side/</link>
		<comments>http://blog.dotsmart.net/2009/06/24/using-windows-7s-xp-mode-to-run-ie-6-and-ie-7-side-by-side/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 09:45:18 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/2009/06/24/using-windows-7s-xp-mode-to-run-ie-6-and-ie-7-side-by-side/</guid>
		<description><![CDATA[Windows 7’s XP Mode is essentially a Windows XP virtual machine that runs in the new Windows 7 version of Virtual PC. This new edition of Virtual PC includes cool features such as seamless windows. The main reason I’m interested in this is to run older versions of Internet Explorer for testing purposes. IE8’s compatibility [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=175&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Windows 7’s XP Mode is essentially a Windows XP virtual machine that runs in the new Windows 7 version of Virtual PC. This new edition of Virtual PC includes cool features such as seamless windows. The main reason I’m interested in this is to run older versions of Internet Explorer for testing purposes. IE8’s compatibility mode does a pretty good job of emulating IE7 but <a href="http://blogs.msdn.com/ie/archive/2009/03/12/site-compatibility-and-ie8.aspx">there are differences</a>, so I investigated how to get “real” IE7 running under Windows 7’s XP Mode, without losing IE6. </p>
<p>Out of the box, the Virtual PC image is Windows XP SP3 with IE6. Here’s IE6 on my Windows 7 desktop:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image.png?w=306&#038;h=358" width="306" height="358" /> </p>
<p>The trick to getting IE6 to appear as a seamless window like this is to launch the Virtual Windows XP virtual machine and in the VM, create a shortcut in the “All Users” Start Menu or desktop:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image13.png?w=282&#038;h=300" width="282" height="300" /> </p>
</p>
<p>After a short delay, the shortcut will be duplicated into the Windows 7 host’s start menu:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image14.png?w=244&#038;h=234" width="244" height="234" /> </p>
<p>When you launch this shortcut in Windows 7, the main Virtual PC window will close and the application will be launched and projected onto your desktop.</p>
<h2>Creating a VM for IE7</h2>
<p>You can’t install IE7 side-by-side with IE6 on the same machine, so to run IE7 at the same time as IE6 we will need to create a new VM. Unfortunately, if you run the VirtualWindowsXP.msi setup again you’ll get a message saying “Setup has detected that Virtual Windows XP is already installed”:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image15.png?w=327&#038;h=252" width="327" height="252" /> </p>
<p>The workaround is to <em>create a new instance of the VM manually </em>using the supplied VHD as the base disk image. To do this do the following:</p>
<p>Open the <strong>Virtual Machines </strong>folder from the Start Menu and click <strong>Create virtual machine</strong>:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image16.png?w=445&#038;h=112" width="445" height="112" /> </p>
<p>Specify a name and location for the virtual machine:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image17.png?w=354&#038;h=274" width="354" height="274" /> </p>
<p>For memory I specified 256MB, which should me more than enough for just running IE7:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image18.png?w=354&#038;h=274" width="354" height="274" /> </p>
<p><strong>Here’s the important bit</strong>. Choose “Create a virtual hard disk using advanced options”</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image19.png?w=354&#038;h=274" width="354" height="274" /> </p>
</p>
</p>
</p>
</p>
<p>…and then choose a <strong>Differencing </strong>disk. This is the same way that the default Virtual Windows XP VM is set up:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image20.png?w=354&#038;h=274" width="354" height="274" /> </p>
<p>If you want, you can change the default name and location (I didn’t bother):</p>
<p>For the <strong>parent virtual hard disk </strong>choose the original Virtual Windows XP virtual disk, which on my machine was at <em>C:\Program Files\Virtual Windows XP\Virtual Windows XP.vhd</em>:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image21.png?w=354&#038;h=274" width="354" height="274" /> </p>
<p>Now start the new Virtual PC you just created from the Virtual Machines folder and complete Windows Setup as appropriate, choosing a computer name unique for your network and an Administrator password:</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image22.png?w=363&#038;h=296" width="363" height="296" /> </p>
</p>
<p>When that’s done:</p>
<ul>
<li><strong>Enable Integration Features </strong>from the Tools menu of the Virtual PC window
<ul>
<li>For credentials enter <em>Administrator </em>and the password you entered during setup. </li>
<li>I chose to <strong>Remember my credentials </strong>for convenience </li>
</ul>
</li>
<li>download and install IE7 in the VM, </li>
</ul>
<p>When IE7 has installed and rebooted, create a shortcut to IE7 in the “All Users” start menu which, after a short delay, will create a corresponding shortcut in the Windows 7 start menu of the host.</p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image23.png?w=401&#038;h=219" width="401" height="219" />&#160;</p>
<p>So here’s the end result, IE6, IE7 and IE8 all running on Windows 7: </p>
<p><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://dotsmart.files.wordpress.com/2009/06/image24.png?w=581&#038;h=521" width="581" height="521" /> </p>
<p>Ahhh, 3 generations, all together – don’t they look adorable?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=175&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2009/06/24/using-windows-7s-xp-mode-to-run-ie-6-and-ie-7-side-by-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image17.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image18.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image19.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image20.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image21.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image22.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image23.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/06/image24.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing WebSVN &#8220;Unable to call svn command&#8221; error</title>
		<link>http://blog.dotsmart.net/2009/06/17/fixing-websvn-unable-to-call-svn-command-error/</link>
		<comments>http://blog.dotsmart.net/2009/06/17/fixing-websvn-unable-to-call-svn-command-error/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 13:15:47 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/2009/06/17/fixing-websvn-unable-to-call-svn-command-error/</guid>
		<description><![CDATA[WebSVN is a great PHP web-based interface to Subversion that we run on our IIS build server. But, after updating to a more recent build we started getting errors like the following when viewing diffs:
Unable to call svn command &#34;svn --non-interactive --config-dir /tmp&#34;
The source of the error is in the getFileContents function in svnlook.php, where [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=147&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.websvn.info/">WebSVN</a> is a great PHP web-based interface to Subversion that we run on our IIS build server. But, after updating to a more recent build we started getting errors like the following when viewing diffs:</p>
<pre>Unable to call svn command &quot;svn --non-interactive --config-dir /tmp&quot;</pre>
<p>The source of the error is in the <code>getFileContents</code> function in svnlook.php, where it’s piping the output of <em>svn cat</em> to <a href="http://www.gnu.org/software/enscript">GNU Enscript</a> (for syntax highlighting) and then parsing the output of that using <em>sed</em>. I guessed that maybe the regex that sed is using isn’t being escaped properly for the Windows command line and therefore failing. </p>
<p>But I noticed that all of this code was in an <code>if($config-&gt;useEnscript)</code> block. Just before that is an <code>if($config-&gt;useGeshi)</code> block that looks a lot simpler. Simpler because <a href="http://sourceforge.net/projects/geshi">GeSHi</a> is PHP-based syntax highlighter, rather than an external command whose output requires special parsing. So I went to our <em>include/config.php</em> and added the <code>$config-&gt;useGeshi();</code> call (as detailed in the <em>distconfig.php </em>template config file), and it all started working happily again!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/147/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/147/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/147/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=147&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2009/06/17/fixing-websvn-unable-to-call-svn-command-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>
	</item>
		<item>
		<title>Unzipping/extracting MSI files</title>
		<link>http://blog.dotsmart.net/2009/05/13/unzipping-extracting-msi-files/</link>
		<comments>http://blog.dotsmart.net/2009/05/13/unzipping-extracting-msi-files/#comments</comments>
		<pubDate>Wed, 13 May 2009 14:55:13 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/2009/05/13/unzippingextracting-msi-files/</guid>
		<description><![CDATA[If, like me, you are constantly wanting to just extract the files from a Windows Installer MSI file quickly, then this is for you.
My ZIP utility of choice 7-Zip appears to support extracting MSI files but in fact extracts all the various weird and wonderful binary streams in the MSI rather than simply just the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=141&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>If, like me, you are constantly wanting to just extract the files from a Windows Installer MSI file quickly, then this is for you.</p>
<p>My ZIP utility of choice <a href="http://www.7-zip.org/">7-Zip</a> <em>appears </em>to support extracting MSI files but in fact extracts all the various weird and wonderful binary streams in the MSI rather than simply just the actual files. Thankfully I stumbled across a Windows Installer switch today after typing <code>msiexec /?</code> that does the job perfectly: the <code>/a</code> “administrative install” switch, e.g.:</p>
<pre>msiexec /a foo.msi /qb TARGETDIR="C:\TEMP\Foo"</pre>
<p>So, what I’ve done is packaged this up as a little registry tweak that conveniently lets you do this by simply right clicking a file like so:</p>
<p><img style="display:inline;border-width:0;" title="image" src="http://dotsmart.files.wordpress.com/2009/05/image.png?w=450&#038;h=112" border="0" alt="image" width="450" height="112" /></p>
<p>Copy and paste the following into a *.reg file and double-click it:</p>
<pre>Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\Msi.Package\shell\Extract MSI\command]
@="msiexec.exe /a \"%1\" /qb TARGETDIR=\"%1 Extracted\""</pre>
<p>Hope that helps!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=141&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2009/05/13/unzipping-extracting-msi-files/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2009/05/image.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing &#8220;Provider: Unspecified error&#8221; when querying LDAP with the ADsDSOObject OLEDB Provider</title>
		<link>http://blog.dotsmart.net/2009/04/17/fixing-provider-unspecified-error-when-querying-ldap-with-adsdsoobject/</link>
		<comments>http://blog.dotsmart.net/2009/04/17/fixing-provider-unspecified-error-when-querying-ldap-with-adsdsoobject/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 09:43:00 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[ADSI]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/?p=130</guid>
		<description><![CDATA[As part of our logon script we have a Windows Script Host script that was failing with “Provider: Unspecified error” (mmn, helpful) but only on some Windows XP machines.
The offending line of code looked like this:
rs = con.Execute("&#60;LDAP://DC=example,DC=com&#62;; (sAMAccountName="+ username +"); ADsPath; subTree")
After some trial and error the fix was this (see if you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=130&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As part of our logon script we have a Windows Script Host script that was failing with “Provider: Unspecified error” (mmn, <em>helpful</em>) but only on some Windows XP machines.</p>
<p>The offending line of code looked like this:</p>
<pre>rs = con.Execute("&lt;LDAP://DC=example,DC=com&gt;; (sAMAccountName="+ username +"); ADsPath; subTree")</pre>
<p>After some trial and error the fix was this (see if you can spot the difference):</p>
<pre>rs = con.Execute("&lt;LDAP://DC=example,DC=com&gt;;(sAMAccountName="+ username +");ADsPath;subTree")</pre>
<p>Can you see what it is? <strong>No spaces after the semicolons</strong>!</p>
<p>Alternatively the SQL-like syntax also seems to be a bit more forgiving:</p>
<pre>rs = con.Execute("SELECT ADsPath FROM 'LDAP://DC=example,DC=com' WHERE sAMAccountName='"+ username +"'")</pre>
<p>It appears that with some later version of ADSI ADsDSOObject (or to give it its full title, the “OLE DB Provider for Microsoft Directory Services”) the query syntax strictness has been relaxed. In any case &#8220;Unspecifed error&#8221; appears to mean &#8220;Syntax error&#8221; in this case.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=130&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2009/04/17/fixing-provider-unspecified-error-when-querying-ldap-with-adsdsoobject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting a machine’s NetBIOS domain name in C#</title>
		<link>http://blog.dotsmart.net/2009/03/11/getting-a-machine%e2%80%99s-netbios-domain-name-in-csharp/</link>
		<comments>http://blog.dotsmart.net/2009/03/11/getting-a-machine%e2%80%99s-netbios-domain-name-in-csharp/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 14:46:06 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/?p=121</guid>
		<description><![CDATA[I tried to find some mechanism to get the current machine&#8217;s NetBIOS domain name (the machine domain, not user domain), but couldn’t find anything in the usual places (e.g. System.Environment). If you want the fancy-schmancy Active Directory DNS domain then you can use Domain.GetComputerDomain().Name from System.DirectoryServices.ActiveDirectory, or another one that I stumbled across in Reflector was IPGlobalProperties.GetIPGlobalProperties().DomainName that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=121&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I tried to find some mechanism to get the current machine&#8217;s NetBIOS domain name (the <strong>machine domain</strong>, not user domain), but couldn’t find anything in the usual places (e.g. <strong>System.Environment</strong>). If you want the fancy-schmancy Active Directory DNS domain then you can use <strong>Domain.GetComputerDomain().Name</strong> from<strong> System.DirectoryServices.ActiveDirectory</strong>, or another one that I stumbled across in Reflector was <strong>IPGlobalProperties.GetIPGlobalProperties().DomainName</strong> that lives in <strong>System.Net.NetworkInformation</strong>. But a simple way of getting the old-skool NetBIOS/LanManager-style machine domain name proved elusive.</p>
<p>Some googling suggested that WMI would provide the answer but I find WMI a little heavyweight, and not always reliable. The information is also probably in the registry somewhere, although I couldn’t find it after a cursory scan. The proper, supported way it would appear is to use the <a href="http://msdn.microsoft.com/en-us/library/aa370672.aspx">Network Management API</a>. So my solution entailed P/Invoking to <em>netapi32.dll</em>.</p>
<p>If you’re after the same information I hope you find the code below useful. Once you&#8217;ve incorporated this in your project, just call the <strong>GetMachineNetBiosDomain</strong> method<strong>.</strong> It will return the machine&#8217;s Workgroup name if the machine is not domain-joined.</p>
<pre name="code" class="csharp">

using System;
using System.Runtime.InteropServices;
using System.ComponentModel;

class NetUtil
{
    [DllImport(&quot;netapi32.dll&quot;, CharSet = CharSet.Auto)]
    static extern int NetWkstaGetInfo(string server,
        int level,
        out WKSTA_INFO_100 info);

    [DllImport(&quot;netapi32.dll&quot;)]
    static extern int NetApiBufferFree(WKSTA_INFO_100 info);

    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
    class WKSTA_INFO_100
    {
        public int wki100_platform_id;
        public string wki100_computername;
        public string wki100_langroup;
        public int wki100_ver_major;
        public int wki100_ver_minor;
    }

    public static string GetMachineNetBiosDomain()
    {
        WKSTA_INFO_100 info;
        int retval = NetWkstaGetInfo(null, 100, out info);
        if (retval != 0)
            throw new Win32Exception(retval);
        string domainName = info.wki100_langroup;
        NetApiBufferFree(info);
        return domainName;
    }
}
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=121&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2009/03/11/getting-a-machine%e2%80%99s-netbios-domain-name-in-csharp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>
	</item>
		<item>
		<title>Disabling direct PDF viewing/opening from the web</title>
		<link>http://blog.dotsmart.net/2009/02/23/disabling-direct-pdf-viewingopening-from-the-web/</link>
		<comments>http://blog.dotsmart.net/2009/02/23/disabling-direct-pdf-viewingopening-from-the-web/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 14:19:02 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/2009/02/23/disabling-direct-pdf-viewingopening-from-the-web/</guid>
		<description><![CDATA[This worries me (more information). It would appear that you could craft PDFs that could hijack someone’s machine simply by their opening the PDF. This is especially pernicious because Adobe Reader is so intent on integrating PDF into Internet Explorer using various Browser Helper Objects and ActiveX Controls that a “drive-by” hijack would be simple [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=118&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.adobe.com/support/security/advisories/apsa09-01.html">This</a> worries me (<a href="http://www.avertlabs.com/research/blog/index.php/2009/02/19/new-backdoor-attacks-using-pdf-documents/">more information</a>). It would appear that you could craft PDFs that could hijack someone’s machine simply by their opening the PDF. This is especially pernicious because Adobe Reader is so intent on integrating PDF into Internet Explorer using various Browser Helper Objects and ActiveX Controls that a “drive-by” hijack would be simple to set up once you’ve crafted the malicious PDF file.</p>
<p>A quick fix (that Works On My Machine™) that prevents the automatic opening/viewing of PDF files from the web is to change the <code>HKEY_CLASSES_ROOT\.pdf\Content Type</code> registry key from <code>application/pdf</code> to something like <code>application/octet-stream</code>. This means that you have to save the files first before opening them.</p>
<p>Some possible scriptable ways of automating this:</p>
<h4>Method 1: A .REG file</h4>
<p>Save the following into a file with a “.reg” file extension and running using <code>regedit.exe /s filename.reg</code>.</p>
<pre>REGEDIT4
[HKEY_CLASSES_ROOT\.pdf]
&quot;Content Type&quot;=&quot;application/octet-stream&quot;</pre>
<h4>Method 2: The REG command</h4>
<p>Alternatively the following, using the reg.exe command will achieve the same result:</p>
<pre>reg add HKCR\.pdf /v &quot;Content Type&quot; /d &quot;application/octet-stream&quot; /f</pre>
<p>You obviously still need to be careful about PDFs, you just have the ability now to actively decide whether you want to open them.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/118/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/118/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/118/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=118&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2009/02/23/disabling-direct-pdf-viewingopening-from-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>
	</item>
		<item>
		<title>Cisco home page FAIL</title>
		<link>http://blog.dotsmart.net/2008/09/25/cisco-home-page-fail/</link>
		<comments>http://blog.dotsmart.net/2008/09/25/cisco-home-page-fail/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 09:23:30 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/2008/09/25/cisco-home-page-fail/</guid>
		<description><![CDATA[UPDATE: it&#8217;s over 2 hours later now and they’ve finally fixed it :)
Cisco’s home page this morning: looks like they ran out of their allocation of lowercase letter ‘t’ (thanks to Chris Venus for pointing it out):
 
Or was it “Speak Like an Irishman” day and nobody told me?
Lowercase ‘t’s were being stripped from the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=104&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="border-right:red 1px solid;border-top:red 1px solid;border-left:red 1px solid;border-bottom:red 1px solid;padding:.5em;"><b>UPDATE:</b> it&#8217;s over 2 hours later now and they’ve finally fixed it :)</p>
<p><a href="http://www.cisco.com/">Cisco’s home page</a> this morning: looks like they ran out of their allocation of lowercase letter ‘t’ (thanks to <a href="http://www.planetvenus.org.uk/">Chris Venus</a> for pointing it out):</p>
<p><img title="image" style="display:inline;border-width:0;" height="513" alt="image" src="http://dotsmart.files.wordpress.com/2008/09/image4.png?w=345&#038;h=513" width="345" border="0" /> </p>
<p>Or was it “Speak Like an Irishman” day and nobody told me?</p>
<p>Lowercase ‘t’s were being stripped from the source which explains why there were no styles, etc:</p>
<p><img title="image" style="display:inline;border-width:0;" height="471" alt="image" src="http://dotsmart.files.wordpress.com/2008/09/image5.png?w=422&#038;h=471" width="422" border="0" /> </p>
<p>Chris reckons it’s a possibly a whitespace-trimming RegEx gone wrong, WDYT?</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=104&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2008/09/25/cisco-home-page-fail/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2008/09/image4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2008/09/image5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Setting Google Chrome as the default browser for Adobe AIR apps</title>
		<link>http://blog.dotsmart.net/2008/09/03/setting-google-chrome-as-the-default-browser-for-adobe-air-apps/</link>
		<comments>http://blog.dotsmart.net/2008/09/03/setting-google-chrome-as-the-default-browser-for-adobe-air-apps/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 20:44:23 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/?p=74</guid>
		<description><![CDATA[
UPDATE: Logan Buesching commented to say that Chrome apparently creates &#8220;ChromeHTML&#8221; shell\open keys except they&#8217;re in HKCR (which is why you get a UAC prompt, it&#8217;s the machine part of the registry), so you can actually just set HKCU\Software\Classes\.htm to ChromeHTML and you&#8217;re done. Logan also goes into more detail as to what&#8217;s going on so check out his post.
It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=74&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div style="border:solid 1px #aaa;margin-bottom:1em;padding:.5em;">
<p><strong>UPDATE:</strong> <a href="http://agoln.net/">Logan Buesching</a> commented to say that Chrome apparently creates &#8220;ChromeHTML&#8221; shell\open keys except they&#8217;re in HKCR (which is why you get a UAC prompt, it&#8217;s the <em>machine</em> part of the registry), so you can actually just set <code>HKCU\Software\Classes\.htm</code> to ChromeHTML and you&#8217;re done. Logan also goes into more detail as to what&#8217;s going on so <a href="http://agoln.net/archives/149">check out his post</a>.</p>
<p>It seems odd that they end up creating a global HKCR key which ulitimately points to an app that&#8217;s installed in a user&#8217;s private profile. I&#8217;m sure this will cause issues if you have multiple people using your machine. Anyway, I guess this is all a bit moot: this is beta software kids, and I&#8217;m sure Google will fix this in due course by release and you may have to undo some of these registry shenanigans for it to work as expected.</p></div>
<p>Google Chrome was a big hit in the office today. To the extent that many of my colleagues were setting it as their default browser already, even though it&#8217;s a beta product. Cwazy.</p>
<p>Unfortunately even if you do click the &#8220;Make Google Chrome my default browser&#8221; button on the Options page, not all applications that launch hyperlinks comply. One of those is the Twitter client <a href="http://www.twhirl.org/">Twhirl</a>, which is an Adobe AIR application (I&#8217;m <em>assuming</em> this is an issue with AIR itself rather than Twhirl doing something silly). I deduced what AIR was doing when trying to locate the default browser by using <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">Sysinternals&#8217; Process Monitor</a> (ProcMon). It was using the current user&#8217;s &#8220;.htm&#8221; file association preference: which on my machine was pointing to <em>FirefoxHTML</em>. So I created a new registry key for <em>GoogleChromeHTML</em> that specified the location of chrome.exe as the file opener and pointed the &#8220;.htm&#8221; setting there, which did the trick.</p>
<p>To make this easier to replicate, and to save having to write tedious explanatory steps detailing exactly what to do &#8211; I&#8217;ve created a short JScript Windows Script file.</p>
<p>Save the following with a &#8220;*.js&#8221; file extension (e.g. <em>ChromeDefaultForAIR.js</em>) and run it:</p>
<pre name="code" class="jscript">

var wshell = new ActiveXObject(&#039;WScript.Shell&#039;);
var chromePath = wshell.ExpandEnvironmentStrings(&#039;%USERPROFILE%\\Local Settings\\Application Data\\Google\\Chrome\\Application\\chrome.exe&#039;);
wshell.RegWrite(&#039;HKCU\\Software\\Classes\\.htm\\&#039;,
   &#039;GoogleChromeHTML&#039;);
wshell.RegWrite(&#039;HKCU\\Software\\Classes\\GoogleChromeHTML\\shell\\open\\command\\&#039;,
    &#039;&quot;&#039; + chromePath + &#039;&quot; &quot;%1&quot;&#039;);
</pre>
<p>Normal caveats for editing your registry and downloading and running random scripts from some idiot&#8217;s blog apply. To revert, set <code>HKCU\Software\Classes\.htm</code> back to FirefoxHTML.</p>
<p>If it helps leave a note in the comments!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotsmart.wordpress.com/74/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotsmart.wordpress.com/74/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=74&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2008/09/03/setting-google-chrome-as-the-default-browser-for-adobe-air-apps/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>
	</item>
		<item>
		<title>Identifying the unidentified problem with Windows Firewall</title>
		<link>http://blog.dotsmart.net/2008/07/30/identifying-the-unidentified-problem-with-windows-firewall/</link>
		<comments>http://blog.dotsmart.net/2008/07/30/identifying-the-unidentified-problem-with-windows-firewall/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 08:43:00 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Vista]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/2008/07/30/identifying-the-unidentified-problem-with-windows-firewall/</guid>
		<description><![CDATA[Recently Windows Vista has been refusing to show the Windows Firewall Settings dialog box and instead showing the ever so informative message: “Windows Firewall: Due to an unidentified problem, Windows cannot display Windows Firewall settings”.

No clues. Nothing in the Event Log. Nothing. Brilliant.
Well I had a brain wave this morning about what might be causing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=65&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently Windows Vista has been refusing to show the <strong>Windows Firewall Settings</strong> dialog box and instead showing the ever so informative message: “<em>Windows Firewall: Due to an unidentified problem, Windows cannot display Windows Firewall settings</em>”.</p>
<p><img style="border-width:0;" height="195" alt="image" src="http://dotsmart.files.wordpress.com/2008/07/image.png?w=499&#038;h=195" width="499" border="0" /></p>
<p>No clues. Nothing in the Event Log. Nothing. Brilliant.</p>
<p>Well I had a brain wave this morning about what might be causing it. Thankfully it turned out to be right. I remembered that on our Windows Domain we have a few Group Policy settings that apply to Windows Firewall. </p>
<p><img style="border-width:0;" height="282" alt="image" src="http://dotsmart.files.wordpress.com/2008/07/image1.png?w=404&#038;h=282" width="404" border="0" /> </p>
<p>In this case the culprit was the “Define program exceptions” that had a few old entries for AVG 7.5 Network Edition. As we’d upgraded to AVG 8.0 recently the program paths were no longer valid, nor really necessary. So I removed them entirely and set the policy back to <em>Not configured</em>. To verify it worked I ran <code><strong>gpupdate /target:computer /force</strong></code> at a command prompt on my workstation and <em>voila: </em>the Windows Firewall Settings dialog box would now appear once more.</p>
<p>&#160;<img style="border-width:0;" height="368" alt="image" src="http://dotsmart.files.wordpress.com/2008/07/image2.png?w=312&#038;h=368" width="312" border="0" /> </p>
<p>Group Policy for Windows Firewall is stored on client machines in the the Registry at:</p>
<pre>HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall</pre>
<p>So if you’re not on a domain and there are registry entries in this location that have been set for some reason, then adjusting them will have the same effect as changing the Group Policy. If you <em>are </em>on a domain then getting the Group Policy fixed is obviously the right approach.</p>
<p>Hope that helps you – leave a comment if it does.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotsmart.wordpress.com/65/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotsmart.wordpress.com/65/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/65/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/65/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/65/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=65&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2008/07/30/identifying-the-unidentified-problem-with-windows-firewall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2008/07/image.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2008/07/image1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2008/07/image2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Solved: &#8220;Cannot read from the source file or disk&#8221;</title>
		<link>http://blog.dotsmart.net/2008/06/12/solved-cannot-read-from-the-source-file-or-disk/</link>
		<comments>http://blog.dotsmart.net/2008/06/12/solved-cannot-read-from-the-source-file-or-disk/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 09:17:12 +0000</pubDate>
		<dc:creator>Duncan Smart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://dotsmart.wordpress.com/2008/06/12/solved-cannot-read-from-the-source-file-or-disk/</guid>
		<description><![CDATA[I&#8217;ve finally solved a problem that&#8217;s been bugging me for years. One of our file shares ended up with several undelete-able files. Attempting to delete them results in &#8220;Error Deleting File or Folder &#8211; Cannot delete file: Cannot read from the source file or disk&#8220;.

Even going to the file&#8217;s properties to check permissions presented a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=57&subd=dotsmart&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve finally solved a problem that&#8217;s been bugging me for years. One of our file shares ended up with several undelete-able files. Attempting to delete them results in &#8220;<em>Error Deleting File or Folder &#8211; Cannot delete file: Cannot read from the source file or disk</em>&#8220;.</p>
<p><a href="http://dotsmart.files.wordpress.com/2008/06/image.png"><img style="border-width:0;" src="http://dotsmart.files.wordpress.com/2008/06/image-thumb.png?w=415&#038;h=191" border="0" alt="" width="415" height="191" /></a></p>
<p>Even going to the file&#8217;s properties to check permissions presented a very blank properties dialog. And a CHKDSK didn&#8217;t sort thing out either.</p>
<p>It turns out the problem was: <strong>the filename ended with a dot, </strong>e.g. it was something like &#8220;<code>C:\Temp\Stuff\Sales Agreement<span style="text-decoration:underline;">.</span></code>&#8220;. As far as Windows is concerned this is an invalid file name: so although it gets reported in a directory listing, the standard Windows APIs for manipulating files subsequently deny its existence.</p>
<p>So how did this file get created in the first place? The answer: a Mac. The file was on a file share which had been accessed by a Mac user. Macs tend to write all sorts of metadata to extra &#8220;._DSStore&#8221; files and suchlike and had left this file behind.</p>
<p>So if Windows doesn&#8217;t appear to allow these file names, how did they get to be created? Well, it turns out that NTFS allows all sort of file name/path weirdness that Windows, or specifically the Win32 API, doesn&#8217;t allow. For example, NTFS actually allows file paths up to 32K but Windows restricts file paths to no more than 260 characters (MAX_PATH). I suppose this is all for DOS/Windows 9x backwards compatibility. As these files were being accessed over a file share I guess the usual Win32 checks are bypassed.</p>
<p>But thankfully you <em>can </em>get Win32 to ignore these checks by prefixing your file paths with <code>\\?\</code>, (ie. <code>C:\Temp\SomeFile.txt</code> becomes <code>\\?\C:\Temp\SomeFile.txt</code>) which I discovered after reading <a href="http://blogs.msdn.com/bclteam/archive/2008/06/10/long-paths-in-net-part-3-of-3-kim-hamilton.aspx">this blog post about long paths in .NET</a>.</p>
<p>So at a command prompt I was able to delete the file using:</p>
<pre>del "\\?\C:\Temp\Stuff\Sales Agreement."</pre>
<p>If it&#8217;s a folder/directory you&#8217;re trying to delete use the rd or rmdir command, e.g.:</p>
<pre>rd /s "\\?\C:\Documents and Settings\User\Desktop\Annoying Folder."</pre>
<p><strong>Tip:</strong> as you&#8217;re typing the file/directory name use the TAB key to auto-complete the name (press TAB repeatedly to cycle through possible names).</p>
<hr />
Of course the corollary of all of this is that you could really annoy somebody by doing this:</p>
<pre>echo Hi &gt; "\\?\%USERPROFILE%\Desktop\Annoying file you can't delete<span style="text-decoration:underline;">.</span>"</pre>
<p>But you wouldn&#8217;t do that would you?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotsmart.wordpress.com/57/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotsmart.wordpress.com/57/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotsmart.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotsmart.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotsmart.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotsmart.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotsmart.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotsmart.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotsmart.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotsmart.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotsmart.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotsmart.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.dotsmart.net&blog=2355202&post=57&subd=dotsmart&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://blog.dotsmart.net/2008/06/12/solved-cannot-read-from-the-source-file-or-disk/feed/</wfw:commentRss>
		<slash:comments>217</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/13ead10356c893aead42be91b5cdcc01?s=96&#38;d=identicon" medium="image">
			<media:title type="html">Duncan Smart</media:title>
		</media:content>

		<media:content url="http://dotsmart.files.wordpress.com/2008/06/image-thumb.png" medium="image" />
	</item>
	</channel>
</rss>