<?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>Blog of Jason Grimme - Programming and All Things Jason &#187; Computers</title>
	<atom:link href="http://studioshorts.com/blog/category/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://studioshorts.com/blog</link>
	<description>I have a computer data interchange format named after me!</description>
	<lastBuildDate>Mon, 19 Dec 2011 23:24:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Build, Sign, and Deploy a Windows 8 Metro App with Powershell</title>
		<link>http://studioshorts.com/blog/2011/12/build-sign-and-deploy-a-windows-8-metro-app-with-powershell/</link>
		<comments>http://studioshorts.com/blog/2011/12/build-sign-and-deploy-a-windows-8-metro-app-with-powershell/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 00:39:47 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=538</guid>
		<description><![CDATA[Very seldom do I run into a problem and feel like I am the first to encounter it, especially with programming. When developing for Windows 8 I feel that way quite a lot. I have been working on a small script to build, sign, and deploy a metro app into the Metro UI environment.  Below [...]]]></description>
			<content:encoded><![CDATA[<p>Very seldom do I run into a problem and feel like I am the first to encounter it, especially with programming.  When developing for <strong>Windows 8</strong> I feel that way quite a lot.</p>
<p>I have been working on a small script to build, sign, and deploy a metro app into the Metro UI environment.  Below is what I have come up with so far. (<strong>Powershell 3.0</strong>).</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">function Get-Batchfile ($file) {<br />
&nbsp; &nbsp; $cmd = &quot;`&quot;$file`&quot; &amp; set&quot;<br />
&nbsp; &nbsp; cmd /c $cmd | Foreach-Object {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $p, $v = $_.split('=')<br />
&nbsp; &nbsp; &nbsp; &nbsp; Set-Item -path env:$p -value $v<br />
&nbsp; &nbsp; }<br />
}<br />
<br />
function Set-VsVars32($version = &quot;11.0&quot;)<br />
{<br />
&nbsp; &nbsp; #$key = &quot;HKLM:SOFTWARE\Microsoft\VisualStudio\&quot; + $version<br />
&nbsp; &nbsp; #$VsKey = Get-ItemProperty -Path $VsKey<br />
<br />
&nbsp; &nbsp; #$VsInstallPath = [System.IO.Path]::GetDirectoryName($VsKey.InstallDir)<br />
&nbsp; &nbsp; #$VsToolsDir = [System.IO.Path]::GetDirectoryName($VsInstallPath)<br />
&nbsp; &nbsp; #$VsToolsDir = [System.IO.Path]::Combine($VsToolsDir, &quot;Tools&quot;)<br />
&nbsp; &nbsp; #$BatchFile = [System.IO.Path]::Combine($VsToolsDir, &quot;vsvars32.bat&quot;)<br />
&nbsp; &nbsp; # I didn't take the time to get the above to work in Windows 8/PS3. &nbsp;Shortcut below.<br />
&nbsp; &nbsp; $BatchFile = 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat'<br />
&nbsp; &nbsp; Get-Batchfile $BatchFile<br />
&nbsp; &nbsp; [System.Console]::Title = &quot;Visual Studio &quot; + $version + &quot; Windows Powershell&quot;<br />
}<br />
<br />
<br />
function Build-Sln($Path, $Config=&quot;Release&quot;)<br />
{<br />
&nbsp; &nbsp; $configParam = &quot;/p:Configuration=&quot; +$Config<br />
&nbsp; &nbsp; msbuild.exe $path $configParam<br />
}<br />
<br />
function Get-AppxPackageByName($Name)<br />
{<br />
&nbsp; &nbsp; $package = Get-AppxPackage | Where {$_.Name -eq $Name}<br />
&nbsp; &nbsp; if($package.Name -ne $Name) { Write-Error &quot;Unable to find package: $Name&quot; }<br />
&nbsp; &nbsp; return $package<br />
}<br />
<br />
# Include the Visual Studio exes in our path<br />
Set-VsVars32<br />
<br />
# Change location to our working project dir<br />
Set-Location 'C:\Users\username\Documents\Visual Studio 11\Projects\discovery\Base\Base\'<br />
<br />
# Call Visual Studio to build your solution<br />
Build-Sln -Path '..\Base.sln' -Config &quot;Release&quot;<br />
<br />
# Remove our Appx file if it already exists<br />
if(Test-Path .\bin\Base.appx) { Remove-Item .\bin\Base.appx }<br />
<br />
# Pack the output into Base.Appx<br />
MakeAppx.exe pack /d .\bin\Release\ /p .\bin\Base.appx<br />
<br />
# Sign &nbsp;the Appx so that it can be deployed. &nbsp;Uses a PFX key (that you already have)<br />
signtool.exe sign /fd sha256 /f .\Base_TemporaryKey.pfx .\Bin\Base.appx<br />
<br />
# Insert the certificate into the root of your cert store. This allows the Appx to be executed.<br />
certutil.exe -addstore root .\Base_Certificate.cer<br />
<br />
#To add an Appx package<br />
Add-AppxPackage -Path .\bin\Base.appx -Verbose <br />
# To remove an Appx package<br />
#Remove-AppxPackage(Get-AppxPackageByName(&quot;9f229500-7554-28302834-a28b-abb26743654a&quot;)) -Verbose</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/12/build-sign-and-deploy-a-windows-8-metro-app-with-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load All Comments on Reddit</title>
		<link>http://studioshorts.com/blog/2011/08/load-all-comments-on-reddit/</link>
		<comments>http://studioshorts.com/blog/2011/08/load-all-comments-on-reddit/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 04:48:19 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=492</guid>
		<description><![CDATA[I recently wanted to perform a search through all the comments for a Reddit story. Rather than clicking on all the &#8220;Load more comments&#8221; links, I figured I would let JavaScript do it for me. If you try to click them all at once, Reddit tends to freeze. This method allows a one second pause [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wanted to perform a search through all the comments for a Reddit story.<br />
Rather than clicking on all the &#8220;Load more comments&#8221; links, I figured I would let JavaScript do it for me.</p>
<p>If you try to click them all at once, Reddit tends to freeze.  This method allows a one second pause between each additional load.</p>
<p>Paste the following in your address bar while on the page, and watch them load:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">javascript<span style="color: #339933;">:</span><br />
<span style="color: #003366; font-weight: bold;">function</span> loadMore<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> id <span style="color: #339933;">=</span> &nbsp;<span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span> id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'loading...'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span> id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'button'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #339933;">+</span> id<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>id<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; next<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #003366; font-weight: bold;">function</span> next<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>loadMore<span style="color: #339933;">,</span> <span style="color: #CC0000;">1000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
loadMore<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>And, if it is of any use, here is the compressed version:</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">javascript<span style="color: #339933;">:</span><span style="color: #003366; font-weight: bold;">function</span> b<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>window.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span>1e3<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #003366; font-weight: bold;">function</span> a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #003366; font-weight: bold;">var</span> a<span style="color: #339933;">=</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #339933;">;</span><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>a<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">html</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;loading...&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>a<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">removeClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;button&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#&quot;</span><span style="color: #339933;">+</span>a<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>b<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span>a<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2011/08/load-all-comments-on-reddit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Excel &#8211; Comparing With Previous Cell and Conditional Formatting</title>
		<link>http://studioshorts.com/blog/2010/12/excel-comparing-cell-with-previous-cell-and-formatting/</link>
		<comments>http://studioshorts.com/blog/2010/12/excel-comparing-cell-with-previous-cell-and-formatting/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 03:19:24 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=454</guid>
		<description><![CDATA[I use a Scrum backlog Excel spreadsheet to keep track of progress made on certain tasks and stories. There is a column for each standup meeting where I document the number of hours remaining on for the task. Usually the amount goes down, but sometimes it goes up and a lot of the time no [...]]]></description>
			<content:encoded><![CDATA[<p>I use a<a href="http://en.wikipedia.org/wiki/Scrum_%28development%29" target="_blank"> Scrum</a> backlog <a href="http://en.wikipedia.org/wiki/Microsoft_Excel">Excel </a>spreadsheet to keep track of progress made on certain tasks and stories.  There is a column for each <a href="http://en.wikipedia.org/wiki/Stand-up_meeting">standup meeting</a> where I document the number of hours remaining on for the task.  Usually the amount goes down, but sometimes it goes up and a lot of the time no progress gets made at all due to other issues.</p>
<p>I wanted to be able to use <strong>conditional formatting</strong> on each cell to indicate how one day compared with the previous.  Green for if the remainder was reduced, red if it increased, yellow it stayed the same, and blue if it was zero.  The most difficult part was figuring out how to reference the previous cell / cell to the left of the current cell that was being formatted.</p>
<h2>Resulting Output</h2>
<div id="attachment_457" class="wp-caption aligncenter" style="width: 440px"><a href="http://studioshorts.com/blog/wp-content/uploads/2010/12/Formatting_Previous_Change_Example1.gif"><img class="size-full wp-image-457" title="Formatting_Previous_Change_Example" src="http://studioshorts.com/blog/wp-content/uploads/2010/12/Formatting_Previous_Change_Example1.gif" alt="" width="430" height="157" /></a><p class="wp-caption-text">Example of using conditional formatting with cell comparrison</p></div>
<h2>Referencing adjacent / previous / left / cell formula</h2>
<p>=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,-1)</p>
<h2>How To</h2>
<ol>
<li>Select &#8216;<strong>Conditional Formatting</strong>&#8216; -&gt; &#8216;Manage Rules&#8217;</li>
<li>Show formatting  rules for: &#8216;<strong>This Worksheet</strong>&#8216;</li>
<li>Select &#8216;<strong>New Rule</strong>&#8216;</li>
<li>Format only cells that contain:
<ul>
<li>First dropdown: Select &#8216;<strong>Cell Value</strong>&#8216;</li>
<li>Second dropdown: Select &#8216;<strong>Greater than</strong>&#8216;</li>
<li>Third input: enter: &#8216;<strong>=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,-1)</strong>&#8216;</li>
<li>Select &#8216;<strong>Format&#8230;</strong>&#8216;</li>
<li>Indicate your format. In my case, a red color since the value increased (negative progress).<br />
<a href="http://studioshorts.com/blog/wp-content/uploads/2010/12/Formatting_Rule_Entry.gif"><img class="aligncenter size-full wp-image-458" title="Formatting_Rule_Entry" src="http://studioshorts.com/blog/wp-content/uploads/2010/12/Formatting_Rule_Entry.gif" alt="" width="528" height="372" /></a></li>
</ul>
</li>
<li><strong>Repeat for each type of comparison</strong>.  I ended up doing five, including one so that if the cell is blank it does nothing.
<ul>
<li>&#8216;<strong>Conditional Formatting</strong>&#8216; -&gt; <strong>Manage Rules</strong></li>
<li>Show formatting rules for: &#8216;<strong>This Worksheet</strong>&#8216;</li>
<li>Select &#8216;<strong>New Rule</strong>&#8216;</li>
<li>Format only cells that contain:
<ul>
<li>First dropdown: &#8216;<strong>Blanks</strong>&#8216;</li>
<li>Make sure the format is normal/empty</li>
<li>Press <strong>Okay</strong></li>
</ul>
<p><a href="http://studioshorts.com/blog/wp-content/uploads/2010/12/Formatting_Rule_Entry_Blank.gif"><img class="aligncenter size-full wp-image-459" title="Formatting_Rule_Entry_Blank" src="http://studioshorts.com/blog/wp-content/uploads/2010/12/Formatting_Rule_Entry_Blank.gif" alt="" width="381" height="372" /></a></li>
<li>At the <strong>Rules Manager</strong>, ensure the view is for &#8216;<strong>This Worksheet</strong>&#8216;</li>
<li>Move your blank/normal rule <strong>to the top</strong></li>
<li>Check &#8216;<strong>Stop If True</strong>&#8216; so that the formatter does not continue to other rules when blank.</li>
</ul>
<p><a href="http://studioshorts.com/blog/wp-content/uploads/2010/12/Conditional_Formatting_Rules_Manager1.gif"><img class="aligncenter size-full wp-image-456" title="Conditional_Formatting_Rules_Manager" src="http://studioshorts.com/blog/wp-content/uploads/2010/12/Conditional_Formatting_Rules_Manager1.gif" alt="" width="618" height="300" /></a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/12/excel-comparing-cell-with-previous-cell-and-formatting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>USB Ports Stop Working &#8211; What To Do</title>
		<link>http://studioshorts.com/blog/2010/10/usb-ports-stop-working-what-to-do/</link>
		<comments>http://studioshorts.com/blog/2010/10/usb-ports-stop-working-what-to-do/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 04:02:19 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=441</guid>
		<description><![CDATA[I have a few iPod/iPhone USB cables, and one of them has a short in it. Somehow when plugged in, it causes every USB port on my computer to &#8220;shut off&#8221;, including for ports which are in use. For the longest time I was restarting my computer to get the ports working again, but luckily [...]]]></description>
			<content:encoded><![CDATA[<p>I have a few iPod/iPhone USB cables, and one of them has a short in it.  Somehow when plugged in, it causes every USB port on my computer to &#8220;shut off&#8221;, including for ports which are in use.  For the longest time I was restarting my computer to get the ports working again, but luckily I found an easier way.</p>
<p>If you open up Device Manager (&#8216;My Computer&#8217; -> Right Click -> &#8216;Properties&#8217; -> &#8216;Device Manager&#8217;) and expand the &#8216;Universal Serial Bus Controllers&#8217; branch, hopefully you will see some items with warning icons.  Right click on each one, click disable, and then enable.  Keep going until your USB ports start to work, usually I have to do each one.</p>
<p><a href="http://studioshorts.com/blog/wp-content/uploads/2010/10/USB_Not_Working_Device_Manager.gif"><img src="http://studioshorts.com/blog/wp-content/uploads/2010/10/USB_Not_Working_Device_Manager-300x245.gif" alt="" title="USB Not Working - Device Manager" width="300" height="245" class="aligncenter size-medium wp-image-442" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/10/usb-ports-stop-working-what-to-do/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick and Simple SilverLight Media Player from Expression Encoder</title>
		<link>http://studioshorts.com/blog/2010/09/quick-and-simple-silverlight-media-player-from-expression-encoder/</link>
		<comments>http://studioshorts.com/blog/2010/09/quick-and-simple-silverlight-media-player-from-expression-encoder/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 04:00:45 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[SilverLight]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=436</guid>
		<description><![CDATA[If you have used Expression Encoder, you have probably seen the XAP files that it comes with to play video files. The sample code they have to embed and play the files seem to be either non existent or too complex. Below is an example for MediaPlayerTemplate.xap with a Smooth Streaming video file. If you [...]]]></description>
			<content:encoded><![CDATA[<p>If you have used <strong>Expression Encoder</strong>, you have probably seen the XAP files that it comes with to play video files.  The sample code they have to embed and play the files seem to be either non existent or too complex.</p>
<p>Below is an example for <strong>MediaPlayerTemplate.xap </strong>with a <strong>Smooth Streaming</strong> video file.  <em>If you haven&#8217;t read about Smooth Streaming, look it up! It is the technology that Netflix uses to stream movies at different quality levels.</em> While undocumented,<strong> if you are using Smooth Streaming</strong> technology you <strong>must have the SmoothStreaming.xap</strong> file in the same location as MediaPlayerTemplate.xap as it will reference it.</p>
<h3>Example Embed Object Markup</h3>
<div class="codecolorer-container html4strict blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">align</span><span style="color: #66cc66;">=</span>center <span style="color: #000066;">valign</span><span style="color: #66cc66;">=</span>middle&gt;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/object.html"><span style="color: #000000; font-weight: bold;">object</span></a> <span style="color: #000066;">data</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;data:application/x-silverlight-2,&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;application/x-silverlight-2&quot;</span> <span style="color: #000066;">width</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;400&quot;</span> <span style="color: #000066;">height</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;300&quot;</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;source&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://server/xap/mediaplayertemplate.xap&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;autoUpgrade&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enableHtmlAccess&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enableGPUAcceleration&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;&lt;<a href="http://december.com/html/4/element/param.html"><span style="color: #000000; font-weight: bold;">param</span></a> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;initparams&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'playerSettings = &nbsp;</span><br />
<span style="color: #009900;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Playlist&gt;</span></span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;AutoLoad&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>AutoLoad&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;AutoPlay&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>AutoPlay&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;DisplayTimeCode&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>DisplayTimeCode&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnableOffline&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnableOffline&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnablePopOut&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnablePopOut&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnableCaptions&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnableCaptions&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;EnableCachedComposition&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>EnableCachedComposition&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;StartMuted&gt;</span>false<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>StartMuted&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;Items&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;PlaylistItem&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">Title</span></a>&gt;</span>My Video Test<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/title.html"><span style="color: #000000; font-weight: bold;">Title</span></a>&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;Description&gt;</span>My video description<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>Description&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;IsAdaptiveStreaming&gt;</span>true<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>IsAdaptiveStreaming&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;MediaSource&gt;</span>http://SmoothStreamingServer/xap/file.ism%5Cmanifest<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>MediaSource&gt;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>PlaylistItem&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>Items&gt;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>Playlist&gt;</span>'/&gt;<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/object.html"><span style="color: #000000; font-weight: bold;">object</span></a>&gt;</span> <br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/09/quick-and-simple-silverlight-media-player-from-expression-encoder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS / ASP.Net, Error CS0016: Could not write to output file</title>
		<link>http://studioshorts.com/blog/2010/09/iis-asp-net-error-cs0016-could-not-write-to-output-file/</link>
		<comments>http://studioshorts.com/blog/2010/09/iis-asp-net-error-cs0016-could-not-write-to-output-file/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 03:32:05 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=429</guid>
		<description><![CDATA[A while ago I was getting an error while attempting to debug an ASP.Net application. I suppose it was trying to push temporary dll files that it needed into the temp directory, but was unable to do so. I feel as though it should be notice that this was a handler (ashx) that was being [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I was getting an error while attempting to debug an ASP.Net application.  I suppose it was trying to push temporary dll files that it needed into the temp directory, but was unable to do so.  I feel as though it should be notice that this was a handler (ashx) that was being integrated with other services.</p>
<p>I was able to rid myself of this message by granting <strong>full control</strong> to <strong>NETWORK SERVICE</strong> on <strong>C:\Windows\Temp</strong>.</p>
<ol>
<li>Right click on C:\Windows\Temp</li>
<li>Security tab</li>
<li>NETWORK SERVICE</li>
<li>Edit</li>
<li>Full Control</li>
<li>Apply/Save/Okay</li>
</ol>
<p>The error page was something along the lines of:</p>
<blockquote><p><strong>Compilation Error </strong><br />
<strong>Description</strong>: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. </p>
<p><strong>Compiler Error Message: CS0016</strong>: <strong>Could not write to output file</strong> &#8216;c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\029384098\029384089\App_Web_foo.aspx.lkajlj.lksjdflkj.dll&#8217; &#8212; &#8216;Access is denied. &#8216;</p>
<p><strong>Source Error:</strong><br />
[No relevant source lines]<br />
Source File:    Line: 0 </p>
<p><strong>Show Detailed Compiler Output</strong>:<br />
c:\windows\system32\inetsrv> &#8220;C:\WINDOWS\Microsoft.NET\Framework64\v2.0.xxxx\csc.exe&#8221; /t:library /utf8output [... Serveral DLL files ...]</p>
<p>Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053<br />
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727<br />
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved. </p>
<p><strong>error CS0016</strong>: <strong>Could not write to output file</strong> &#8216;c:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\799cd6a3\81d0d718\App_Web_foo.aspx.cdcab7d2.uqpderdl.dll&#8217; &#8212; &#8216;<strong>Access is denied</strong>. &#8216;</p>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/09/iis-asp-net-error-cs0016-could-not-write-to-output-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Visual Studio: Slow to Remove / Delete Files From Solution</title>
		<link>http://studioshorts.com/blog/2010/08/visual-studio-slow-to-remove-delete-files-from-solution/</link>
		<comments>http://studioshorts.com/blog/2010/08/visual-studio-slow-to-remove-delete-files-from-solution/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 04:48:49 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=419</guid>
		<description><![CDATA[At work I have been noticing an increase in time it takes to remove a file from a solution. Several weeks ago it took about ten seconds, but recently it has been taking a few minutes. The other day while waiting for a file to be deleted I decided to figure out what was causing [...]]]></description>
			<content:encoded><![CDATA[<p>At work I have been noticing an increase in time it takes to remove a file from a solution.  Several weeks ago it took about ten seconds, but recently it has been taking a few minutes.<br />
The other day while waiting for a file to be deleted I decided to figure out what was causing the problem.  I was able to do some research, find the problem, <strong>and</strong> fix the problem <strong>while</strong> Visual Studio was trying to remove a file  Once I fixed the problem the file finished deleting.</p>
<h3>The Fix</h3>
<p>It&#8217;s a simple fix, really.  <strong>Empty your recycle bin</strong>.  I had about two gigabytes of files and after removing them, the deletion process took less than a second.  It&#8217;s unusual to be happy when you get what should have received in the first place.  Then again, it&#8217;s a Microsoft product.  Maybe I should be happy it works most of the time <img src='http://studioshorts.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/08/visual-studio-slow-to-remove-delete-files-from-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>STSADM.exe &#8211; Copy and Paste == Command Line Error</title>
		<link>http://studioshorts.com/blog/2010/07/stsadm-exe-copy-and-paste-command-line-error/</link>
		<comments>http://studioshorts.com/blog/2010/07/stsadm-exe-copy-and-paste-command-line-error/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 01:44:38 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Powershell]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[stsadm]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=237</guid>
		<description><![CDATA[stsadm.exe is a command driven application that I use very often to administrate a SharePoint server via command line.  More specifically, it is very heavily in a PowerShell script I wrote that deploys multiple solutions to SharePoint. The general syntax for stsadm is stsadm -o createsiteinnewdb -url http://sharepointserver More than often I will run into [...]]]></description>
			<content:encoded><![CDATA[<p><strong>stsadm.exe</strong> is a command driven application that I use very often to administrate a<strong> SharePoint</strong> server via command line.  More specifically, it is very heavily in a <strong>PowerShell</strong> script I wrote that deploys multiple solutions to SharePoint.</p>
<p>The general syntax for stsadm is stsadm -o createsiteinnewdb -url http://sharepointserver</p>
<p>More than often I will run into a problem where when I copy and paste these commands, stsadm says that it is invalid &#8220;<strong>Command line error</strong>&#8220;.  This can be very frustrating because the command looks correct in every sense.  Sometimes I even copy and paste from a known good command and I still get rejected.  If I type in the command, it works just fine.<br />
So eventually I had enough and converted the copied and pasted string and the manually typed  string to binary to compare.</p>
<pre>stsadm –o createsiteinnewdb</pre>
<p>01110011011101000111001101100001011001000110110100100000<strong>10010110</strong>01101111<br />
001000000110001101110010011001010110000101110100011001010111001101101001<br />
011101000110010101101001011011100110111001100101011101110110010001100010</p>
<pre>stsadm -o createsiteinnewdb</pre>
<p>01110011011101000111001101100001011001000110110100100000<strong>00101101</strong>01101111<br />
001000000110001101110010011001010110000101110100011001010111001101101001<br />
011101000110010101101001011011100110111001100101011101110110010001100010</p>
<p>I highlighted the octet that is different in the two strings.  These bits represent the dash in the <strong>-</strong>o flag.  In the rejected string, the dash turned out to be an <strong>en-dash</strong> (&amp;#8211) while in the accepted string, the dash is a <strong>hyphen</strong> (&amp;#x2d).  In the text-editors I use, the en-dash and hyphen have no visual diference.  In most font-faces used by text editors (Courier-New) for example, the two are visually identical. <strong>Somewhere along the line, hypens are being converted to en-dashes</strong>.  I know word processors will do this automatically, but I am obviously not using a word processor.</p>
<p>I know this all sounds silly, but if you do some Googling you will find quite a few people who have experienced this problem specifically with stsadm.  So if stsadm rejects you like an ambitious nerd trying to pick up girls at the bar, check your dashes!</p>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/07/stsadm-exe-copy-and-paste-command-line-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Renew IP / Reconnect for AT&amp;T 2701HG-B 2Wire, JDownloader</title>
		<link>http://studioshorts.com/blog/2010/07/renew-ip-reconnect-for-att-2701hg-b-2wire-jdownloader/</link>
		<comments>http://studioshorts.com/blog/2010/07/renew-ip-reconnect-for-att-2701hg-b-2wire-jdownloader/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 01:16:25 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=207</guid>
		<description><![CDATA[Update: Somehow this is a relatively popular post.  It was originally intended only for documenting how to renew your IP by scripting, but I have received a few request for simply documenting how to do it manually.  Instructions for this are at the end of the article. I&#8217;ve been a pretty big fan of the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> Somehow this is a relatively popular post.  It was originally intended only for documenting how to renew your IP by scripting, but I have received a few request for simply documenting how to do it manually.  Instructions for this are at the end of the article.</p>
<p>I&#8217;ve been a pretty big fan of the open sourced Java program <strong>JDownloader</strong>, which basically allows you to paste in links to files anywhere on the web and it will download them.  This is very useful for downloading files one at a time, throttling, and many other great reasons.</p>
<p>Many hosts will limit the amount of data a certain user may download in a certain period of time by IP address.  I recently found out that JD has a feature that will log into your modem and perform a reconnect which results in a new IP address.  I was able to get this to work with my Linksys router, but not on my <strong>piece of junk</strong> <a href="http://www.att.com/equipment/accessory-details/?q_categoryid=&amp;q_sku=sku3950271&amp;q_manufacturer=&amp;q_model=">AT&amp;T 2701HG-B 2Wire Wireless Gateway DSL Router Modem</a>.</p>
<p>JDownloader has a preset for this modem, but it did not work for me.  It has the ability to create a macro of you performing the reset, but that didn&#8217;t seem to work either.  In fact, it resulted in JD crashing or freezing each time.  I took the time to study how the piece of junk (The modem, not JD) works and understand the HSRC HTTP macro format, or whatever it is.</p>
<p>The modem uses one main &#8216;index&#8217; page, if you will, that accepts a page parameter which tells it which action to perform.  I assume it uses XSLT (based on the urls) to format the output of each action.  In addition to the <strong>PAGE</strong> parameter, it also passes around the <strong>THISPAGE </strong>and <strong>NEXTPAGE </strong>variables.  Some of the pages use GET while some use POST.  In most cases I was able to use GET instead of POST.  The forms duplicate parameters out the Ying-Yang which is one thing thatI think ma yhave caused the freezing.</p>
<p>A given page url might look like: http://192.168.1.254/xslt?PAGE=B01&amp;THISPAGE=A06&amp;NEXTPAGE=B01</p>
<p>Some of the primary page actions are:<br />
<strong>A01</strong> System Summary<br />
<strong>A08 </strong> Restart System<br />
<strong>A07</strong> Gateway View details<br />
<strong>B01 </strong> Connection Summary<br />
<strong>C01</strong> Network Summary</p>
<p>So anyways, I put together the HSRC macro script which has worked great so far (1 hour!)  Here it is:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[[[HSRC]]]<br />
[[[STEP]]]<br />
[[[REQUEST]]]<br />
GET / HTTP/1.1<br />
Host: %%%routerip%%%<br />
[[[/REQUEST]]]<br />
[[[/STEP]]]<br />
<br />
[[[STEP]]]<br />
[[[REQUEST]]]<br />
GET /xslt?PAGE=A08&amp;amp;THISPAGE=A07&amp;amp;NEXTPAGE=A08 HTTP/1.1<br />
Host: %%%routerip%%%<br />
[[[/REQUEST]]]<br />
[[[/STEP]]]<br />
<br />
[[[STEP]]]<br />
[[[REQUEST]]]<br />
POST /xslt HTTP/1.1<br />
Host: %%%routerip%%%<br />
<br />
PAGE=A02_POST&amp;amp;THISPAGE=A07&amp;amp;NEXTPAGE=A08&amp;amp;PASSWORD=%%%pass%%%<br />
[[[/REQUEST]]]<br />
[[[/STEP]]]<br />
<br />
[[[STEP]]]<br />
[[[REQUEST]]]<br />
POST /xslt HTTP/1.1<br />
Host: %%%routerip%%%<br />
<br />
PAGE=A08_POST&amp;amp;THISPAGE=A08&amp;amp;NEXTPAGE=A08_POST<br />
[[[/REQUEST]]]<br />
[[[/STEP]]]<br />
<br />
[[[STEP]]]<br />
[[[REQUEST]]]<br />
GET / HTTP/1.1<br />
Host: %%%routerip%%%<br />
[[[/REQUEST]]]<br />
[[[/STEP]]]<br />
<br />
[[[/HSRC]]]</div></td></tr></tbody></table></div>
<p>I&#8217;ll have to do about three thousand automatic reconnects for this to have resulted in in a positive time expense.  Hopefully if you can use this it will count for something!  Please let me know <img src='http://studioshorts.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Manually Renewing Your IP Address on the AT&amp;T 2701HG-B 2Wire</h2>
<p><em>For the beginners.</em></p>
<ol>
<li>In your web browser (Hopefully Mozilla Firefox, Google Chrome, or Opera) enter in either the address <a href="http://192.168.1.254/" target="_blank">http://192.168.1.254</a> or <a href="http://gateway.2wire.net">http://gateway.2wire.net</a>.</li>
<li>In the &#8216;<strong>Network at a Glance</strong>&#8216; box, select &#8216;<strong>View Details</strong>&#8216; for your gateway.</li>
<li>Select &#8216;<strong>Restart the System</strong>&#8216;.</li>
<li>You will (most likely) be asked to enter in your password.  This password is probably not the same as the password to use your wireless network, but could be.  It is possible it is blank if you have never set it, in which case you really need to.  If you do not know the password, you can hold the reset button on the router for 30 seconds and do a full reset.</li>
<li>Once your password has been verified, <strong>confirm</strong> that you want to restart.<br />
<strong>Note</strong>: You along with everybody else on your network will be <strong>disconnected from the Internet for about two minutes</strong>.</li>
<li>After about two minutes, your computer should reconnect automatically.  If it does not, try either toggling your wireless if you know how or simply restart your computer.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/07/renew-ip-reconnect-for-att-2701hg-b-2wire-jdownloader/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PowerShell: Copy Directory With Progress Meter</title>
		<link>http://studioshorts.com/blog/2010/06/powershell-copy-directory-with-progress-meter/</link>
		<comments>http://studioshorts.com/blog/2010/06/powershell-copy-directory-with-progress-meter/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 04:51:57 +0000</pubDate>
		<dc:creator>Jason Grimme</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false">http://studioshorts.com/blog/?p=196</guid>
		<description><![CDATA[Earlier today I thought it would be nice to display a progress meter while copying a directory. After thinking about it for a while I realized that I would need to do something asynchronous, like creating a new thread.  Much to my dismay I found no such thing which was quite a shock considering how [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier today I thought it would be nice to <strong>display a progress meter while copying a directory</strong>.  After thinking about it for a while I realized that I would need to do something asynchronous, like creating a new thread.  Much to my dismay I found no such thing which was quite a shock considering how impressed I have been with PowerShell.</p>
<p>A few hours later it was still bothering me so I did some more research and found the Start-Job cmdlet which seemed to do what I wanted.  Two hours later and I had the function below.</p>
<p>I won&#8217;t say that it is the best function in the world, or even that it is <em>that</em> great because it isn&#8217;t.  But it does seem to work.  I&#8217;m still quite new to PowerShell, so forgive any foolish mistakes.<br />
If you set -DisplayMeter $True, the built in <strong>progress meter</strong> (Write-Progress) meter will be displayed.</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">function</span> Copy<span style="color: pink;">-</span>Progress<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Jason Grimme - StudioShorts.com</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Copies a Source directory to Destination, while displaying progress.</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$Source</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;Source parameter required.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$destination</span> <span style="color: pink;">=</span> $<span style="color: #000000;">&#40;</span><span style="color: #0000FF;">throw</span> <span style="color: #800000;">&quot;Destination parameter required.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>boolean<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$Verbose</span> <span style="color: pink;">=</span> <span style="color: #800080;">$true</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>boolean<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$Overwrite</span> <span style="color: pink;">=</span> <span style="color: #800080;">$true</span><span style="color: pink;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span>boolean<span style="color: #000000;">&#93;</span> <span style="color: #800080;">$DisplayMeter</span> <span style="color: pink;">=</span> <span style="color: #800080;">$false</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Setup temporary environment variables that will passed between the jobs</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#[boolean] $ENV:Copy_Progress_Finished = $false;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$ENV</span>:Copy_Progress_Source <span style="color: pink;">=</span> <span style="color: #800080;">$Source</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$ENV</span>:Copy_Progress_Desttination <span style="color: pink;">=</span> <span style="color: #800080;">$destination</span>;&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #008000;"># Unless we aren't overwriting, remove the future directory </span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Overwrite</span><span style="color: #000000;">&#41;</span> <span style="color: #FF0000;">-and</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Test-path</span> <span style="color: #800080;">$dest</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">remove-item</span> <span style="color: #800080;">$dest</span> <span style="color: #008080; font-style: italic;">-Recurse</span> <span style="color: #008080; font-style: italic;">-Force</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000;"># Create our job or 'thread'</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$job</span> <span style="color: pink;">=</span> Start<span style="color: pink;">-</span>Job <span style="color: #000000;">&#123;</span> <span style="color: #008080; font-weight: bold;">copy-item</span> <span style="color: #800080;">$ENV</span>:Copy_Progress_Source <span style="color: #800080;">$ENV</span>:Copy_Progress_Desttination <span style="color: #008080; font-style: italic;">-recurse</span> <span style="color: #008080; font-style: italic;">-force</span> <span style="color: #000000;">&#125;</span>;<br />
&nbsp; &nbsp; <span style="color: #008000;">#[string] $eventName = &quot;Copy-Progress_JobStateChanged1&quot;;&nbsp; &nbsp; </span><br />
&nbsp; &nbsp; <span style="color: #008000;">#Register-ObjectEvent $job -EventName StateChanged -SourceIdentifier $eventName -Action { $ENV:Copy_Progress_Finished = $true;&nbsp; if( [string]$($Sender.JobStateInfo) -ne &quot;Completed&quot;){ Write-Host &quot;Did not complete: Job $($Sender.Id) $($Sender.JobStateInfo)&quot;; } &nbsp; &nbsp; &nbsp; &nbsp;} | out-null</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000;"># Get the size of the source directory</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$SourceSize</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Get-ChildItem</span> <span style="color: #800080;">$source</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Measure-Object</span> <span style="color: #008080; font-style: italic;">-property</span> length <span style="color: #008080; font-style: italic;">-sum</span><span style="color: #000000;">&#41;</span>.sum;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">double</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$DestinationSize</span> <span style="color: pink;">=</span> <span style="color: #804000;">0</span>;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #008000;"># Do/While the size of the destination directory is less than the source</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">do</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># Once the destination directory has been created by Copy-Item</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Test-path</span> <span style="color: #800080;">$dest</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># Calculate the current size and the percent complete</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">double</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$DestinationSize</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Get-ChildItem</span> <span style="color: #800080;">$dest</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Measure-Object</span> <span style="color: #008080; font-style: italic;">-property</span> length <span style="color: #008080; font-style: italic;">-sum</span><span style="color: #000000;">&#41;</span>.sum<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#91;</span><span style="color: #008080;">int</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$percentComplete</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$DestinationSize</span> <span style="color: pink;">/</span> <span style="color: #800080;">$SourceSize</span><span style="color: #000000;">&#41;</span><span style="color: pink;">*</span> <span style="color: #804000;">100</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$Verbose</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot;Current Size: $DestinationSize bytes. &nbsp;Percent Complete: $percentComplete%&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$DisplayMeter</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Progress</span> <span style="color: #008080; font-style: italic;">-Activity</span> <span style="color: #800000;">&quot;Performing Copy...&quot;</span> <span style="color: #008080; font-style: italic;">-PercentComplete</span> <span style="color: #800080;">$percentComplete</span> <span style="color: #008080; font-style: italic;">-CurrentOperation</span> <span style="color: #800000;">&quot;$percentComplete% complete&quot;</span> &nbsp;<span style="color: #008080; font-style: italic;">-Status</span> <span style="color: #800000;">&quot;Please wait.&quot;</span>&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">start-sleep</span> <span style="color: #008080; font-style: italic;">-Milliseconds</span> <span style="color: #804000;">500</span>;<br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">while</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$SourceSize</span> <span style="color: #FF0000;">-gt</span> <span style="color: #800080;">$DestinationSize</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #008000;">#while($ENV:Copy_Progress_Finished -ne $true);</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$Verbose</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">write-Host</span> <span style="color: #800000;">&quot;= Copy-Progress $percentComplete% Complete&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;= Source: '$Source', Destination: '$destination'&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;= Source Size: $SourceSize bytes. &nbsp;Destination Size: $DestinationSize bytes&quot;</span>; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000;"># Unset the variables that we don't want to hang around</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$ENV</span>:Copy_Progress_Finished <span style="color: pink;">=</span> <span style="color: #800080;">$null</span>;<br />
&nbsp; &nbsp; <span style="color: #800080;">$ENV</span>:Copy_Progress_Source <span style="color: pink;">=</span> <span style="color: #800080;">$null</span>;<br />
&nbsp; &nbsp; <span style="color: #800080;">$ENV</span>:Copy_Progress_Desttination <span style="color: pink;">=</span> <span style="color: #800080;">$null</span>;<br />
&nbsp; &nbsp; <span style="color: #008000;">#Unregister-Event $eventName; &nbsp; </span><br />
&nbsp; &nbsp; <br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;">#Example Usage</span><br />
Copy<span style="color: pink;">-</span>Progress <span style="color: pink;">-</span>Source <span style="color: #800000;">&quot;C:\scripts\msc\&quot;</span> <span style="color: #008080; font-style: italic;">-Destination</span> <span style="color: #800000;">&quot;C:\scripts\temp\&quot;</span> <span style="color: #008080; font-style: italic;">-Verbose</span> <span style="color: #800080;">$true</span> <span style="color: pink;">-</span>Overwrite <span style="color: #800080;">$true</span> <span style="color: pink;">-</span>DisplayMeter <span style="color: #800080;">$True</span>;</div></td></tr></tbody></table></div>
<p>Because of how PowerShell reads file sizes, this function does not work with copying individual files.  <strong>It must be a directory</strong>.  If <strong>anybody</strong> can find a way to read a file while it is being copied to and grab  the true<strong> file size at that moment in time</strong>, I would be very interested.  I am also looking for a better way to pass variables from the main scope into the Start-Job scriptblock, using $env: variables isn&#8217;t very professional.</p>
<p>An example of the output with Verbose on and the Display meter off would be something like this:</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">PS</span> C:\scripts<span style="color: pink;">&gt;</span> Copy<span style="color: pink;">-</span>Progress <span style="color: pink;">-</span>Source <span style="color: #800000;">&quot;C:\scripts\Dino\&quot;</span> <span style="color: #008080; font-style: italic;">-Destination</span> <span style="color: #800000;">&quot;C:\scripts\Saur\&quot;</span> <span style="color: #008080; font-style: italic;">-Verbose</span> <span style="color: #800080;">$true</span><span style="color: pink;">-</span>Overwrite <span style="color: #800080;">$true</span> <span style="color: pink;">-</span>DisplayMeter <span style="color: #800080;">$false</span>;<br />
Current Size: <span style="color: #804000;">3639974</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">1</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">27120693</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">5</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">50755136</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">9</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">67796400</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">11</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">84230737</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">14</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">106248435</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">18</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">217981590</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">37</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">318419162</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">54</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">397551370</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">67</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">413262946</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">70</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">431720922</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">73</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">446876222</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">75</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">466876615</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">79</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">483184623</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">81</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">505980571</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">85</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">521798269</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">88</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">536622872</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">90</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">552066196</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">93</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">574065976</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">97</span><span style="color: pink;">%</span><br />
Current Size: <span style="color: #804000;">593613675</span> bytes. &nbsp;Percent Complete: <span style="color: #804000;">100</span><span style="color: pink;">%</span><br />
<span style="color: pink;">=</span> Copy<span style="color: pink;">-</span>Progress <span style="color: #804000;">100</span><span style="color: pink;">%</span> Complete<br />
<span style="color: pink;">=</span> Source: <span style="color: #800000;">'C:\scripts\Dino\'</span><span style="color: pink;">,</span> Destination: <span style="color: #800000;">'C:\scripts\Saur\'</span><br />
<span style="color: pink;">=</span> Source Size: <span style="color: #804000;">593613675</span> bytes. &nbsp;Destination Size: <span style="color: #804000;">593613675</span> bytes</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://studioshorts.com/blog/2010/06/powershell-copy-directory-with-progress-meter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

