<?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>Andrew Morgan &#187; replace dll</title>
	<atom:link href="http://andrewmorgan.ie/tag/replace-dll/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewmorgan.ie</link>
	<description>Grumpy ramblings</description>
	<lastBuildDate>Fri, 30 Jun 2017 09:24:25 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>Another handy little tool, Move On Boot.</title>
		<link>http://andrewmorgan.ie/2013/02/another-handy-little-tool-move-on-boot/</link>
		<comments>http://andrewmorgan.ie/2013/02/another-handy-little-tool-move-on-boot/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 14:00:16 +0000</pubDate>
		<dc:creator><![CDATA[andyjmorgan]]></dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[File locked]]></category>
		<category><![CDATA[replace dll]]></category>
		<category><![CDATA[replace file on boot]]></category>

		<guid isPermaLink="false">http://andrewmorgan.ie/?p=2588</guid>
		<description><![CDATA[Upon receiving a new dll from a support provider recently, I could not replace the existing file, as the file was in use by the system. A restart to safemode also wielded the same result. Dang! I wanted to use the PendingFileRenameOperations registry key to instruct windows to copy a file during the boot process. The issue with this key and behavior is that in order to tell windows to delete a file, the next line to the source file must be blank&#8230; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a href="/wp-content/uploads/2013/02/red_copy.png"><img class="size-full wp-image-2593 alignright" alt="red_copy" src="/wp-content/uploads/2013/02/red_copy.png" width="64" height="64" /></a>Upon receiving a new dll from a support provider recently, I could not replace the existing file, as the file was in use by the system. A restart to safemode also wielded the same result. Dang!</p>
<p>I wanted to use the <a href="http://technet.microsoft.com/en-us/library/cc960241.aspx" target="_blank">PendingFileRenameOperations</a> registry key to instruct windows to copy a file during the boot process.</p>
<p>The issue with this key and behavior is that in order to tell windows to delete a file, the next line to the source file must be blank&#8230; if you manually try to add a blank line to regedit you receive the following error!</p>
<p><a href="/wp-content/uploads/2013/02/error.png"><img class="aligncenter size-full wp-image-2591" alt="error" src="/wp-content/uploads/2013/02/error.png" width="399" height="144" /></a></p>
<p>I needed an application to move a file during the boot process of windows before the service or handle held the file I wanted to replace open. I decided to write a new tool called MoveOnBoot.exe.</p>
<p>MoveOnBoot leverages the <a href="http://technet.microsoft.com/en-us/library/cc960241.aspx" target="_blank">PendingFileRenameOperations</a> registry key and the <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa365240(v=vs.85).aspx" target="_blank">MoveFileEx</a> Api to move the file on boot simply and easily.</p>
<p><strong>Move on boot does the following:</strong></p>
<ol>
<li>Adds the copy jobs to the PendingFileRename key you specify.</li>
<li>Copies the new file into the target directory with an  <strong>_newer file</strong> extension.</li>
<li><em>Optional</em>: instructs windows to copy the current file to a _old extension</li>
<li>instructs windows to replace the target file with the _Newer file.</li>
</ol>
<p>&nbsp;</p>
<p><strong>How to use it:</strong></p>
<p>Simply select the source and destination files as below:</p>
<p><a href="/wp-content/uploads/2013/02/ui.png"><img class="aligncenter size-full wp-image-2589" alt="UI" src="/wp-content/uploads/2013/02/ui.png" width="366" height="308" /></a></p>
<p>Optionally choose to backup the target file during the operation with the check box above.</p>
<p>Once you have added all the files you need to replace, you can check the queue by going to file &gt; view pending operations:</p>
<p><a href="/wp-content/uploads/2013/02/results.png"><img class="aligncenter size-full wp-image-2590" alt="results" src="/wp-content/uploads/2013/02/results.png" width="595" height="308" /></a></p>
<p>And that&#8217;s it! restart the device and let windows do the hard work.</p>
<p><strong>Optionally</strong>, if you chose to backup the file as part of the operation, you will find an _old file in the target directory as below:</p>
<p><a href="/wp-content/uploads/2013/02/after-reboot.png"><img class="aligncenter size-full wp-image-2592" alt="after reboot" src="/wp-content/uploads/2013/02/after-reboot.png" width="441" height="284" /></a></p>
<p>&nbsp;</p>
<p><strong>Download:</strong></p>
<p><a href="https://www.box.com/s/ywzs7t96awm0ulq63uoz" target="_blank">Stand alone Binary.</a></p>
<p><a href="https://www.box.com/s/exl2k97p0w3xqawwqnxz" target="_blank">Source code.</a></p>
<p><strong>Support information:</strong></p>
<ul>
<li>Requires Administrator privileges.</li>
<li>Requires .net framework 2.0 or greater.</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewmorgan.ie/2013/02/another-handy-little-tool-move-on-boot/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
