<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>David Eason's Code Portfolio</title>
	<atom:link href="http://thinkingoutloud.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkingoutloud.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sun, 04 May 2008 19:38:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='thinkingoutloud.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>David Eason's Code Portfolio</title>
		<link>http://thinkingoutloud.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://thinkingoutloud.wordpress.com/osd.xml" title="David Eason&#039;s Code Portfolio" />
	<atom:link rel='hub' href='http://thinkingoutloud.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Data conversion example in Perl</title>
		<link>http://thinkingoutloud.wordpress.com/2008/05/04/3/</link>
		<comments>http://thinkingoutloud.wordpress.com/2008/05/04/3/#comments</comments>
		<pubDate>Sun, 04 May 2008 00:15:02 +0000</pubDate>
		<dc:creator>David Eason</dc:creator>
				<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://thinkingoutloud.wordpress.com/?p=3</guid>
		<description><![CDATA[This is a one-off to convert Dinesh Prabhu&#8217;s Romanized Urdu-English dictionary into comma separated value format (.CSV) to be opened in Microsoft Excel and then pasted into the Microsoft Excel workbook included with G&#252;nther&#8217;s Vocabulary Cards for Palm.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thinkingoutloud.wordpress.com&amp;blog=14780&amp;post=3&amp;subd=thinkingoutloud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a one-off to convert <a href="http://smriti.com/urdu/urdu.dictionary.html">Dinesh Prabhu&#8217;s Romanized Urdu-English dictionary</a> into comma separated value format (.CSV) to be opened in Microsoft Excel and then pasted into the Microsoft Excel workbook included with <a href="http://www.dolphin-world.de/software/vocabulary.php">G&uuml;nther&#8217;s Vocabulary Cards for Palm</a>.</p>
<p><pre class="brush: python;">
open (INPUT, &quot;&lt; $ARGV[0]&quot;) || die &quot;Can't open file $ARGV[0].\n&quot;;

while () {

	if ($_ =~ /([^\:]+)\:\s*([PATHSG])\s+(n.f.|n.m.|pron.|adj.|v.|adv.|intj.|prep.|suff.|pref.)\s+(.*)/)
	{
		($urdu, $origin, $part, $english) = ($1, $2, $3, $4);
		print &quot;\&quot;$urdu \[$part\] \[$origin\]\&quot;,\&quot;\&quot;,\&quot;\&quot;,\&quot;\&quot;,\&quot;$english\&quot;\n&quot;;
	}

}
close(INPUT)
</pre></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/thinkingoutloud.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/thinkingoutloud.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thinkingoutloud.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thinkingoutloud.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thinkingoutloud.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thinkingoutloud.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thinkingoutloud.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thinkingoutloud.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thinkingoutloud.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thinkingoutloud.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thinkingoutloud.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thinkingoutloud.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thinkingoutloud.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thinkingoutloud.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thinkingoutloud.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thinkingoutloud.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thinkingoutloud.wordpress.com&amp;blog=14780&amp;post=3&amp;subd=thinkingoutloud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thinkingoutloud.wordpress.com/2008/05/04/3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd22759b3bf84fefd9dbc85890a43b77?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thinkingoutloud</media:title>
		</media:content>
	</item>
		<item>
		<title>Batch files to convert mp3 podcasts to space-saving spx files</title>
		<link>http://thinkingoutloud.wordpress.com/2008/05/03/5/</link>
		<comments>http://thinkingoutloud.wordpress.com/2008/05/03/5/#comments</comments>
		<pubDate>Sun, 04 May 2008 01:55:09 +0000</pubDate>
		<dc:creator>David Eason</dc:creator>
				<category><![CDATA[batch]]></category>

		<guid isPermaLink="false">http://thinkingoutloud.wordpress.com/?p=5</guid>
		<description><![CDATA[If you Google for something to convert mp3 to speex format, you won&#8217;t find much. I couldn&#8217;t find a method on the internet to automatically and easily convert them, so maybe my batch files below are a first of sorts. It has worked for me with Windows 2000 and Windows Vista, however it does have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thinkingoutloud.wordpress.com&amp;blog=14780&amp;post=5&amp;subd=thinkingoutloud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you Google for something to convert mp3 to speex format, you won&#8217;t find much. I couldn&#8217;t find a method on the internet to automatically and easily convert them, so maybe my batch files below are a first of sorts. It has worked for me with Windows 2000 and Windows Vista, however it does have some issues with certain characters in podcast names, such as &reg;, which I can fix if there is any interest.</p>
<p>Why would you want to convert one lossy audio format to another lossy audio format, with the resulting noticeable loss of quality that results? Because podcasts aren&#8217;t really available in .wav format, and .spx format is more efficient than .mp3 for the spoken word and saves a little space on my Palm Tungsten T3&#8242;s SD card.</p>
<p>If you want to get this working yourself, you&#8217;ll need the <a href="http://juicereceiver.sourceforge.net/">Juice</a> podcast receiver, <a href="http://www.videohelp.com/tools/ffmpeg">ffmpeg Windows binaries</a> and <a href="http://www.roed.republika.pl/speexw/">speexenc</a> (look for the speexw installer):<br />
I will assume you extract ffmpeg to C:\TOOLS, and install speex to the default C:\SPEEXW, and that you copy and paste the batch files into Notepad and save to C:\BAT. Make sure that you append ;C:\TOOLS;C:\SPEEXW;C:\BAT to your existing <a href="http://www.computerhope.com/issues/ch000549.htm">PATH</a> environment variable. You will also have to make sure the folders C:\PODCASTS and C:\PDA2GO exist.</p>
<p>Look for ipodder.cfg. On Vista, it should be in C:\Users\YOUR LOGIN NAME\AppData\Roaming\iPodder. Change the download directory to C:\\PODCASTS (double backslashes intentional) which is used in the batch files below. (In Windows 2000 or XP, you can also change this in the GUI, but in Vista you can&#8217;t even open the GUI until you change it because the line refers to My Documents which in Vista has changed to simply Documents.)</p>
<p>From Juice, click File &gt; Preferences, go to the Advanced tab, and check the box which says &#8220;Run this command after each download&#8221; and type the following in the text box below it:<br />
<code>podwork "%f" "c:\pda2go"</code></p>
<p>If you are running Windows Vista, you will need to go to properties of Juice.exe and set it to run in Windows XP SP2 compatibility mode (this is a requirement of being able to run Juice 2.2 on Vista, not a requirement of podwork.cmd):<br />
<a href="http://thinkingoutloud.files.wordpress.com/2008/05/juice-vista1.jpg"><img src="http://thinkingoutloud.files.wordpress.com/2008/05/juice-vista1.jpg?w=550" alt=""   class="alignnone size-full wp-image-17" /></a></p>
<p>The <strong>podwork.cmd</strong> script below converts a single file from mp3 to speex format. You will want to experiment with the quality variable (10 is the maximum, and at 7 the lesser quality is noticeable).</p>
<p><strong>podwork.cmd</strong></p>
<p><pre class="brush: vb;">
@echo off
rem podwork.cmd
rem thanks to 1CMDFAQ.TXT by Prof. Timo Salmi for
rem bringing my DOS skills into the 21st Century :)
rem See http://www.netikka.net/tsneti/info/tscmd.htm
setlocal enableextensions
set quality=7

rem set pod to your source folder (no trailing slash)
set pod=c:\podcasts

if [%2]==[] goto :EOF
if [%tmp%]==[] goto :EOF

set ptmp=%tmp%\
set ptmp=%ptmp:\\=\%
set ptmp=%ptmp:~0,-1%

if not exist &quot;%ptmp%\*.*&quot; goto :EOF

set pfol=%~dp1
set pfol=%pfol%\
set pfol=%pfol:\\=\%
set pfol=%pfol:~0,-1%
for %%a in (&quot;%pfol%&quot;) do set pfol=%%~nxa

set tful=%~2
set tful=%tful%\
set tful=%tful:~0,-1%

if not exist &quot;%tful%\*.*&quot; goto :EOF
for %%a in (&quot;%tful%&quot;) do set tfol=%%~nxa

rem Make necessary tree structures
xcopy &quot;%pod%&quot; &quot;%ptmp%\podwork\&quot; /t
xcopy &quot;%pod%&quot; &quot;%tful%&quot; /t

rem Skip if Speex file already exists
if exist &quot;%tful%\%pfol%\%~n1.spx&quot; goto :EOF

@echo on
ffmpeg -i &quot;%~1&quot; &quot;%ptmp%\podwork\%pfol%\%~n1.wav&quot;
if not exist &quot;%ptmp%\podwork\%pfol%\%~n1.wav&quot; goto :EOF
speexenc --quality %quality% &quot;%ptmp%\podwork\%pfol%\%~n1.wav&quot; &quot;%tful%\%pfol%\%~n1.spx&quot;
@echo off
endlocal
</pre><br />
<strong><br />
IMPORTANT NOTE: WordPress.com gets confused by double hyphens: Line 44 should start off &#8220;speexenc &#45;&#45;quality&#8221; not &#8220;speexenc &mdash;quality&#8221; or &#8220;speexenc -quality&#8221;.</strong></p>
<p>That works for new podcast downloads, but since I had downloaded some podcasts already, I wrote a quick <strong>podsweep.cmd</strong> script to run podwork.cmd for each pre-existing mp3 file. Make sure Juice is closed before running it. It is hard-coded for what I use as my Juice top-level download folder and my output folder:</p>
<p><strong>podsweep.cmd</strong></p>
<p><pre class="brush: vb;">
cd \podcasts
sweep.cmd for %%f in (*.mp3) do podwork &quot;%%~ff&quot; &quot;c:\pda2go&quot;
</pre></p>
<p>podsweep.cmd depends on <strong>sweep.cmd</strong> to run the command in every directory. With sweep.cmd, I mimic an ancient MS-DOS tool from the 80&#8242;s called SWEEP.COM:</p>
<p><strong>sweep.cmd</strong></p>
<p><pre class="brush: vb;">
@echo off
setlocal
oldcd=%cd%
for /R %%D in (.) do (
  cd &quot;%%D&quot;
  %*
)
cd /d %cd%
endlocal
</pre></p>
<p>Thanks to <a href="http://chris.pirillo.com/2007/02/10/how-to-make-juice-22-work-in-windows-vista/">Chris Pirillo</a> for the information on getting Juice to work in Windows Vista.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/thinkingoutloud.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/thinkingoutloud.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thinkingoutloud.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thinkingoutloud.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thinkingoutloud.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thinkingoutloud.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thinkingoutloud.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thinkingoutloud.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thinkingoutloud.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thinkingoutloud.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thinkingoutloud.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thinkingoutloud.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thinkingoutloud.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thinkingoutloud.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thinkingoutloud.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thinkingoutloud.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thinkingoutloud.wordpress.com&amp;blog=14780&amp;post=5&amp;subd=thinkingoutloud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thinkingoutloud.wordpress.com/2008/05/03/5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd22759b3bf84fefd9dbc85890a43b77?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thinkingoutloud</media:title>
		</media:content>

		<media:content url="http://thinkingoutloud.files.wordpress.com/2008/05/juice-vista1.jpg" medium="image" />
	</item>
		<item>
		<title>Drivercab Helper (AutoIT3 example)</title>
		<link>http://thinkingoutloud.wordpress.com/2008/05/03/drivercab-helper-autoit3-example/</link>
		<comments>http://thinkingoutloud.wordpress.com/2008/05/03/drivercab-helper-autoit3-example/#comments</comments>
		<pubDate>Sun, 04 May 2008 01:23:16 +0000</pubDate>
		<dc:creator>David Eason</dc:creator>
				<category><![CDATA[AutoIT3]]></category>

		<guid isPermaLink="false">http://thinkingoutloud.wordpress.com/?p=4</guid>
		<description><![CDATA[This is a utility I wrote that works in conjunction with HFSLIP to slipstream additional drivers into a Windows 2000 or XP install. My announcement thread on MSFN has instructions and a screen shot. It is written in AutoIT3, which is similar to modern BASIC. The GUI work was done in Koda form designer.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thinkingoutloud.wordpress.com&amp;blog=14780&amp;post=4&amp;subd=thinkingoutloud&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a utility I wrote that works in conjunction with <a href="http://hfslip.org">HFSLIP</a> to slipstream additional drivers into a Windows 2000 or XP install. My <a href="http://www.msfn.org/board/DrivercabHelper-Version-11-t89021.html">announcement thread on MSFN</a> has instructions and a screen shot. It is written in <a href="http://www.autoitscript.com/autoit3/">AutoIT3</a>, which is similar to modern BASIC. The GUI work was done in <a href="http://koda.darkhost.ru/">Koda</a> form designer.</p>
<p><pre class="brush: vb;">
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Drivercab Helper
; Version 1.2
; by David Eason

; Thanks to (in no order)
; TommyP and Tomcat76 for HFSLIP
; Tim Fehlman for sample code described in &quot;Folder Recursion in Autoit&quot; at http://dailycupoftech.com/folder-recursion-in-autoit/
; Lookfar, LazyCat, and JosBe for Koda Form Designer for AutoIt
; Jon Bennett for Autoit3 and adding Unicode support for version v3.2.4.0

; Requires Autoit v3.2.4.0 build to compile due to Unicode support

; History
; 1.1 First  version ;)
; 1.2 Added support for Unicode .INF files

#include &lt;guiconstants .au3&gt;
#include &lt;file .au3&gt;

If @AutoItVersion &lt; &quot;3.2.4.0&quot; Then
	MsgBox(0, &quot;Version Check&quot;, &quot;This AutoIt script requires v.3.2.4.0 or later&quot;)
	Exit 1
EndIf

If @Unicode &lt;&gt; 1 Then
	MsgBox(0, &quot;Unicode Check&quot;, &quot;This AutoIt script requires the Unicode build&quot;)
	Exit 2
EndIf

; Globals
Dim $SourceFolder, $DestFolder, $StopProcessingFiles, $dir

#Region ### START Koda GUI section ### Form=d:\drivercabhelper\aform1.kxf
$Form1_1 = GUICreate(&quot;Drivercab Helper 1.1 for HFSLIP&quot;, 591, 507, 229, 78)
$Group1 = GUICtrlCreateGroup(&quot;Log&quot;, 13, 189, 560, 299)
$Edit1 = GUICtrlCreateEdit(&quot;&quot;, 26, 209, 534, 267, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_HSCROLL, $WS_VSCROLL))
GUICtrlSetData(-1, &quot;&quot;)
GUICtrlCreateGroup(&quot;&quot;, -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup(&quot;&amp;Folders&quot;, 13, 20, 560, 117)
$Input1 = GUICtrlCreateInput(&quot;&quot;, 137, 40, 361, 21)
GUICtrlSetTip(-1, &quot;Specify the folder containing existing INF files and driver files&quot;)
$Button1 = GUICtrlCreateButton(&quot;...&quot;, 512, 40, 36, 20, 0)
$Label1 = GUICtrlCreateLabel(&quot;&amp;Source folder:&quot;, 33, 46, 76, 17)
$Input2 = GUICtrlCreateInput(&quot;&quot;, 137, 85, 361, 21)
GUICtrlSetTip(-1, &quot;Specify the folder to be deleted and populated with modified INF files and existing driver files&quot;)
$Button2 = GUICtrlCreateButton(&quot;...&quot;, 512, 85, 36, 20, 0)
$Label2 = GUICtrlCreateLabel(&quot;&amp;Destination folder:&quot;, 33, 85, 95, 17)
$Label3 = GUICtrlCreateLabel(&quot;Destination folder will be deleted and overwritten&quot;, 137, 111, 282, 17)
GUICtrlSetFont(-1, 8, 800, 0, &quot;MS Sans Serif&quot;)
GUICtrlCreateGroup(&quot;&quot;, -99, -99, 1, 1)
$Button3 = GUICtrlCreateButton(&quot;Delete and &amp;regenerate destination folder now!&quot;, 253, 150, 297, 20, 0)
$Label4 = GUICtrlCreateLabel(&quot;&amp;ISOTITLE&quot;, 32, 152, 58, 17)
$Input3 = GUICtrlCreateInput(&quot;HFSLIPCD&quot;, 88, 152, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

If $CmdLine[0] &gt; 0 Then
	GUICtrlSetData($Input1, $CmdLine[1])
EndIf

If $CmdLine[0] &gt; 1 Then
	GUICtrlSetData($Input2, $CmdLine[2])
EndIf

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			$dir = FileSelectFolder(&quot;Source folder&quot;, &quot;&quot;, 6)
			If @error = 0 Then
				GUICtrlSetData($Input1, $dir)
			EndIf
		Case $Button2
			$dir = FileSelectFolder(&quot;Destination folder (will be overwritten)&quot;, &quot;&quot;, 7)
			If @error = 0 Then
				GUICtrlSetData($Input2, $dir)
			EndIf
		Case $Button3
			If StringStripWS(GUICtrlRead($Input3), 1) = &quot;&quot; Then
				GUICtrlSetData($Input3, &quot;HFSLIPCD&quot;)
			EndIf
			$IsoTitle = GUICtrlRead($Input3)
			$CabLine = '1 = &quot;' &amp; $IsoTitle &amp; '&quot;,driver.cab,,&quot;\I386&quot;'
			$SourceFolder = GUICtrlRead($Input1)
			$DestFolder = GUICtrlRead($Input2)
			If ValidateFolders($SourceFolder, $DestFolder) Then
				$StopProcessingFiles = False
				DirRemove($DestFolder, 1)
				ScanFolder($SourceFolder, $DestFolder)
				If Not $StopProcessingFiles Then
					LogToWindow('Completed reading &quot;' &amp; $SourceFolder &amp; '&quot; and writing &quot;' &amp; $DestFolder &amp; '&quot;.')
					MsgBox(262144, &quot;Drivercab Helper&quot;, &quot;Drivercab Helper has finished.&quot;)
				EndIf
			EndIf
	EndSwitch
WEnd


Func ValidateFolders($SourceFolder, $DestFolder)

	If StringRight($SourceFolder, 1) = &quot;\&quot; Or StringRight($SourceFolder, 1) = &quot;/&quot; Then
		$SourceFolder = StringLeft($SourceFolder, StringLen($SourceFolder) - 1)
		GUICtrlSetData($Input1, $SourceFolder)
	EndIf

	If StringRight($DestFolder, 1) = &quot;\&quot; Or StringRight($SourceFolder, 1) = &quot;/&quot; Then
		$SourceFolder = StringLeft($DestFolder, StringLen($DestFolder) - 1)
		GUICtrlSetData($Input2, $DestFolder)
	EndIf

	If $SourceFolder = &quot;&quot; Then
		ShowError('Please specify a source folder.')
		Return False
	EndIf

	If _PathFull($SourceFolder) &lt;&gt; $SourceFolder Then
		ShowError('Source folder &quot;' &amp; $SourceFolder &amp; '&quot; cannot be a relative path.')
		Return False
	EndIf

	; Source folder must exist
	If DirGetSize($SourceFolder) = -1 Then
		ShowError('Source folder &quot;' &amp; $SourceFolder &amp; '&quot;does not exist.')
		Return False
	EndIf


	If $DestFolder = &quot;&quot; Then
		ShowError('Please specify a destination folder.')
		Return False
	EndIf

	If _PathFull($DestFolder) &lt;&gt; $DestFolder Then
		ShowError('Destination folder &quot;' &amp; $DestFolder &amp; '&quot; cannot be a relative path.')
		Return False
	EndIf

	If DirGetSize($DestFolder) &lt;&gt; -1 Then
		LogToWindow('Destination folder &quot;' &amp; $DestFolder &amp; '&quot;exists and will be overwritten.')
		; not an error
	EndIf

	If StringInStr($SourceFolder, $DestFolder) &gt; 0 Then
		ShowError('Destination folder &quot;' &amp; $DestFolder &amp; '&quot; must not contain source folder &quot;' &amp; $SourceFolder &amp; '&quot;.')
		Return False
	EndIf


	Return True
EndFunc   ;==&gt;ValidateFolders

Func LogToWindow($s)
	GUICtrlSetData($Edit1, $s &amp; @CRLF, 1)
EndFunc   ;==&gt;LogToWindow

Func ModifyInfFile($SourceFileName, $DestFileName)

	Local $line, $comment, $in_sourcedisksfiles, $section_name_this_line
	Local $comment_pos, $equals_pos, $left_bracket_pos, $right_bracket_pos
	Local $BOMCheck

	$BOMCheck = _BOMCheck($SourceFileName)

	If $BOMCheck = -1 Then
		ShowError('Unable to determine if &quot;' &amp; $SourceFileName &amp; '&quot; is ANSI or Unicode.')
		Return False
	EndIf

	$SourceInfFile = FileOpen($SourceFileName, 0) ;Read

	If $SourceInfFile = -1 Then
		ShowError('Unable to open file &quot;' &amp; $SourceFileName &amp; '&quot; for reading.')
		Return False
	EndIf


	$DestInfFile = FileOpen($DestFileName, 10 + $BOMCheck)  ; Erase + Write + Unicode Mode

	If $DestInfFile = -1 Then
		ShowError('Unable to open file &quot;' &amp; $DestFileName &amp; '&quot; for writing.')
		FileClose($SourceInfFile)
		Return False
	EndIf

	LogToWindow('Reading ' &amp; '&quot;' &amp; $SourceFileName &amp; '&quot;,' &amp; @CRLF &amp; 'Writing &quot;' &amp; $DestFileName &amp; '&quot;.')

	$in_sourcedisksfiles = False
	$line_num = 0
	While 1
		$line = FileReadLine($SourceInfFile)
		If @error = -1 Then ExitLoop
		$line_num = $line_num + 1
		$comment_pos = StringInStr($line, &quot;;&quot;)
		If $comment_pos &gt; 0 Then
			$comment = StringMid($line, $comment_pos, StringLen($line))
			$line = StringLeft($line, $comment_pos - 1)
		Else
			$comment = &quot;&quot;
		EndIf

		StringStripWS($line, 8)
		$left_bracket_pos = StringInStr($line, &quot;[&quot;)
		If $left_bracket_pos &gt; 0 Then
			$right_bracket_pos = StringInStr($line, &quot;]&quot;)
			$section_name_this_line = StringMid($line, $left_bracket_pos, $right_bracket_pos)
			$section_name = $section_name_this_line;
			Switch StringUpper($section_name_this_line)
				Case &quot;[SOURCEDISKSNAMES]&quot;, &quot;[SOURCEDISKSNAMES.X86]&quot;, &quot;[SOURCEDISKSNAMES.X64]&quot;
					FileWriteLine($DestInfFile, $line &amp; $comment)
					FileWriteLine($DestInfFile, $CabLine)
					LogToWindow($SourceFileName &amp; '(' &amp; $line_num &amp; '): Inserted &quot;' &amp; $CabLine &amp; '&quot; in section &quot;' &amp; $section_name &amp; '&quot;.')
					$in_sourcedisksfiles = False
				Case &quot;[SOURCEDISKSFILES]&quot;
					FileWriteLine($DestInfFile, $line &amp; $comment)
					$in_sourcedisksfiles = True
				Case Else
					;Still a section header
					FileWriteLine($DestInfFile, $line &amp; $comment)
					$in_sourcedisksfiles = False
			EndSwitch
		Else
			;Not a section header
			If $in_sourcedisksfiles = True Then
				$equals_pos = StringInStr($line, &quot;=&quot;, 0, -1)
				If $equals_pos &gt; 0 Then
					$old_line = $line
					$line = StringLeft($line, $equals_pos) &amp; &quot;1&quot;
					LogToWindow($SourceFileName &amp; '(' &amp; $line_num &amp; '):  Changed &quot;' &amp; $old_line &amp; '&quot; to &quot;' &amp; $line &amp; '&quot; in section &quot;' &amp; $section_name &amp; '&quot;.')
				EndIf
			EndIf
			FileWriteLine($DestInfFile, $line &amp; $comment)
		EndIf
		$section_name_this_line = &quot;&quot;;
	WEnd

	
	FileClose($SourceInfFile)
	FileClose($DestInfFile)
	Return True
EndFunc   ;==&gt;ModifyInfFile

Func ScanFolder($SourceFolder, $DestFolder)

	If $StopProcessingFiles Then
		Return
	EndIf

	Local $Search
	Local $File
	Local $FileAttributes
	Local $SourceFullFilePath
	Local $DestFullFilePath

	$Search = FileFindFirstFile($SourceFolder &amp; &quot;\*.*&quot;)

	While Not $StopProcessingFiles
		If $Search = -1 Then
			ExitLoop
		EndIf

		$File = FileFindNextFile($Search)
		If @error Then ExitLoop

		$SourceFullFilePath = $SourceFolder &amp; &quot;\&quot; &amp; $File
		$DestFullFilePath = $DestFolder &amp; &quot;\&quot; &amp; $File
		$FileAttributes = FileGetAttrib($SourceFullFilePath)

		If StringInStr($FileAttributes, &quot;D&quot;) Then
			ScanFolder($SourceFullFilePath, $DestFullFilePath)
		Else
			LogFile($SourceFullFilePath, $DestFullFilePath)
		EndIf

	WEnd

	FileClose($Search)
EndFunc   ;==&gt;ScanFolder

Func LogFile($SourceFileName, $DestFileName)
	If StringLen($SourceFileName) &gt;= 4 And StringUpper(StringRight($SourceFileName, 4)) = &quot;.INF&quot; Then
		If Not ModifyInfFile($SourceFileName, $DestFileName) Then
			$StopProcessingFiles = True
		EndIf
	Else
		$FCStatus = FileCopy($SourceFileName, $DestFileName, 8)
		If $FCStatus = 1 Then
			LogToWindow('Copied &quot;' &amp; $SourceFileName &amp; '&quot; to &quot;' &amp; $DestFileName &amp; '&quot;.')
		Else
			ShowError('Unable to copy &quot;' &amp; $SourceFileName &amp; '&quot; to &quot;' &amp; $DestFileName &amp; '&quot;.')
			$StopProcessingFiles = True
		EndIf
	EndIf
EndFunc   ;==&gt;LogFile

Func ShowError($ErrStr)
	MsgBox(16, &quot;Error&quot;, $ErrStr)
EndFunc   ;==&gt;ShowError




; Function Name:   _BOMCheck()
;
; Description:     Determines whether a given file is ANSI,
;                  UTF-16 Little Endian, UTF-16 Big Endian, or UTF-8
;
; Syntax:          _BOMCheck ( $filename )
;
; Parameter(s):    $filename   = The file to check

;
; Requirement(s):  Must be Unicode build of AutoIt v3.2.4.0 or later.
;
; Return Value(s): ANSI or Unsupported:    Returns 0
;                  UTF-16 Little Endian:   Returns 32
;                  UTF-16 Big Endian:      Returns 64
;                  UTF-8:                  Returns 128
;                  Problem opening file:   Returns -1
;                  The general idea with the return value is that it can
;                  be used in the calculation of the FileOpen mode


; Author:          David Eason

; Sample usage:
; While 1
;     Local $file = FileOpenDialog(&quot;Choose file&quot;, @DesktopDir &amp; &quot;\&quot;, &quot;Text files (*.txt;*.inf)&quot;, 3)
;     if @error = 1 Then ExitLoop
;     MsgBox(0,&quot;&quot;, _BOMCheck($file))
; Wend



Func _BOMCheck(ByRef $filename)

	; Supported Byte Order Markers for non-ANSI
	Local $BOMS[3]
	$BOMS[0] = Binary(&quot;0xFFFE&quot;)     ;UTF-16 Little Endian
	$BOMS[1] = Binary(&quot;0xFEFF&quot;)     ;UTF-16 Big Endian
	$BOMS[2] = Binary(&quot;0xEFBBBF&quot;)   ;UTF-8

	; Corresponding mode bit for FileOpen
	Local $FileModes[3]
	$FileModes[0] = 32
	$FileModes[1] = 64
	$FileModes[2] = 128

	Local $FH = FileOpen($filename, 4)

	If $FH = -1 Then
		Return -1
	EndIf
	Local $FirstBytes = FileRead($FH, 3)

	If @error = -1 Then
		FileClose($FH)
		Return -1
	EndIf

	Local $I
	For $I = 0 To 2
		If BinaryMid($FirstBytes, 1, BinaryLen($BOMS[$I])) = BinaryMid($BOMS[$I], 1, BinaryLen($BOMS[$I])) Then
			FileClose($FH)
			Return $FileModes[$I]
		EndIf
	Next

	; If still here, then it is presumed ANSI
	FileClose($FH)
	Return 0

EndFunc   ;==&gt;_BOMCheck
</pre></file></guiconstants></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/thinkingoutloud.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/thinkingoutloud.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thinkingoutloud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thinkingoutloud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thinkingoutloud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thinkingoutloud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thinkingoutloud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thinkingoutloud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thinkingoutloud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thinkingoutloud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thinkingoutloud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thinkingoutloud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thinkingoutloud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thinkingoutloud.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thinkingoutloud.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thinkingoutloud.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thinkingoutloud.wordpress.com&amp;blog=14780&amp;post=4&amp;subd=thinkingoutloud&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thinkingoutloud.wordpress.com/2008/05/03/drivercab-helper-autoit3-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fd22759b3bf84fefd9dbc85890a43b77?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">thinkingoutloud</media:title>
		</media:content>
	</item>
	</channel>
</rss>
