<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Robert McMurray's Blog [MSFT]</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/robert_mcmurray/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/feed.xml</link>
    <description>Discussing IIS, FTP, WebDAV, FPSE, WMI, ADSI, ISAPI, ASP, Java, FastCGI, etc. ;-)</description>
    <lastBuildDate>Wed, 16 May 2018 23:56:44 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Updated IIS FTP Service Extensibility References</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/updated-iis-ftp-service-extensibility-references</link>
      <pubDate>Wed, 16 May 2018 23:56:44 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/?p=2005</guid>
      <description><![CDATA[It's hard to believe that it has already been six years since I wrote my Extensibility Updates in...]]></description>
      <content:encoded><![CDATA[<p>It's hard to believe that it has already been six years since I wrote my <em><a href="https://blogs.msdn.microsoft.com/robert_mcmurray/2012/04/20/extensibility-updates-in-the-ftp-8-0-service/" target="_blank">Extensibility Updates in the FTP 8.0 Service</a></em> blog, and it has been nine years since I wrote my <em><a href="https://blogs.msdn.microsoft.com/robert_mcmurray/2009/04/23/ftp-7-5-service-extensibility-references/" target="_blank">FTP 7.5 Service Extensibility References</a></em> blog. (Wow… where has all that time gone?) In any event, those blogs introduced several of the APIs that were added to the IIS FTP service which allow developers to provide custom pre-processing and post-processing functionality. (For example, automatically unzipping a compressed file after it has been uploaded, or implementing <a href="https://docs.microsoft.com/iis/develop/developing-for-ftp/how-to-use-managed-code-c-to-create-an-ftp-provider-that-prevents-leeching" target="_blank">anti-leeching functionality</a>.)</p> <p>That being said, for some reason the managed-code APIs that were introduced in later versions of IIS were never fully documented, but we have rectified that problem. With that in mind, the links listed below will take you to the appropriate article for each API.</p> <ul> <li><a href="https://msdn.microsoft.com/library/dd692905.aspx" target="_blank">FTP Managed-Code Extensibility API Reference</a><br>Describes the managed-code extensibility APIs of the service for IIS 7.5 and later.  <ul> <li><a href="https://msdn.microsoft.com/library/dd692896.aspx" target="_blank">FTP Managed-Code Extensibility Classes</a><br>Describes the managed-code classes for the FTP service.  <ul> <li><a href="https://msdn.microsoft.com/library/mt846377.aspx" target="_blank">BaseProvider</a><br>Defines the base provider for FTP extensibility classes.  <ul> <li><a href="https://msdn.microsoft.com/library/mt846371.aspx" target="_blank">Dispose</a><br>Releases the unmanaged resources used by the class, and optionally releases the managed resources.  <li><a href="https://msdn.microsoft.com/library/mt846373.aspx" target="_blank">Initialize</a><br>Retrieves configuration settings for the class. </li></ul> <li><a href="https://msdn.microsoft.com/library/dd692903.aspx" target="_blank">FtpLogEntry</a><br>Contains logging information for use with the <a href="https://msdn.microsoft.com/library/dd692885.aspx" target="_blank">IFtpLogProvider</a> interface.  <li><a href="https://msdn.microsoft.com/library/mt846376.aspx" target="_blank">FtpPreprocessParameters</a><br>Contains session information for use with the <a href="https://msdn.microsoft.com/library/mt846374.aspx" target="_blank">IFtpPreprocessProvider</a> interface.  <li><a href="https://msdn.microsoft.com/library/mt846378.aspx" target="_blank">FtpPostprocessParameters</a><br>Contains session information for use with the <a href="https://msdn.microsoft.com/library/mt846369.aspx" target="_blank">IFtpPostprocessProvider </a>interface. </li></ul> <li><a href="https://msdn.microsoft.com/library/mt846379.aspx" target="_blank">FTP Managed-Code Extensibility Enumerations</a><br>Describes the managed-code enumerations for the FTP service.  <ul> <li><a href="https://msdn.microsoft.com/library/mt846372.aspx" target="_blank">FtpAccess</a><br>Defines the authorization levels for use with the <a href="https://msdn.microsoft.com/library/mt846375.aspx" target="_blank">IFtpAuthorizationProvider</a> interface.  <li><a href="https://msdn.microsoft.com/library/mt846368.aspx" target="_blank">FtpProcessStatus</a><br>Defines the process statuses for use with the <a href="https://msdn.microsoft.com/library/mt846369.aspx" target="_blank">IFtpPostprocessProvider</a> and <a href="https://msdn.microsoft.com/library/mt846374.aspx" target="_blank">IFtpPreprocessProvider</a> interfaces. </li></ul> <li><a href="https://msdn.microsoft.com/library/dd692904.aspx" target="_blank">FTP Managed-Code Extensibility Interfaces</a><br>Describes the managed-code interfaces for the FTP service.  <ul> <li><a href="https://msdn.microsoft.com/library/dd692892.aspx" target="_blank">IFtpAuthenticationProvider</a><br>Provides an interface for authenticating an FTP user.  <ul> <li><a href="https://msdn.microsoft.com/library/dd692879.aspx" target="_blank">AuthenticateUser</a><br>Checks if a user name and password are valid </li></ul> <li><a href="https://msdn.microsoft.com/library/mt846375.aspx" target="_blank">IFtpAuthorizationProvider</a><br>Provides an interface for authorizing an FTP user.  <ul> <li><a href="https://msdn.microsoft.com/library/mt846366.aspx" target="_blank">GetUserAccessPermission</a><br>Determines the access level for a user. </li></ul> <li><a href="https://msdn.microsoft.com/library/dd692893.aspx" target="_blank">IFtpHomeDirectoryProvider</a><br>Provides an interface for retrieving the path to a user's FTP home directory.  <ul> <li><a href="https://msdn.microsoft.com/library/dd692881.aspx" target="_blank">GetUserHomeDirectoryData</a><br>Returns the physical path of the home directory for a user. </li></ul> <li><a href="https://msdn.microsoft.com/library/dd692885.aspx" target="_blank">IFtpLogProvider</a><br>Provides an interface for logging FTP activity.  <ul> <li><a href="https://msdn.microsoft.com/library/dd692894.aspx" target="_blank">Log</a><br>Performs logging activity for the <a href="https://msdn.microsoft.com/library/dd692885.aspx" target="_blank">IFtpLogProvider</a> interface. </li></ul> <li><a href="https://msdn.microsoft.com/library/mt846369.aspx" target="_blank">IFtpPostprocessProvider</a><br>Provides an interface for implementing custom functionality after an FTP command has completed.  <ul> <li><a href="https://msdn.microsoft.com/library/mt846367.aspx" target="_blank">HandlePostprocess</a><br>Implements custom functionality after an FTP command has completed. </li></ul> <li><a href="https://msdn.microsoft.com/library/mt846374.aspx" target="_blank">IFtpPreprocessProvider</a><br>Provides an interface for implementing custom functionality before an FTP command has completed.  <ul> <li><a href="https://msdn.microsoft.com/library/mt846370.aspx" target="_blank">HandlePreprocess</a><br>Implements custom functionality before an FTP command is processed </li></ul> <li><a href="https://msdn.microsoft.com/library/dd692895.aspx" target="_blank">IFtpRoleProvider</a><br>Provides an interface for authorization and role checks.  <ul> <li><a href="https://msdn.microsoft.com/library/dd692899.aspx" target="_blank">IsUserInRole</a><br>Checks if a user is a member of a specific role. </li></ul></li></ul></li></ul></li></ul> <p>And as always, there are a dozen or so articles in the <a href="https://docs.microsoft.com/iis/develop/developing-for-ftp/" target="_blank"><em>Developing for FTP</em></a> section of the official IIS documentation that will walk you through the process of creating your own custom FTP functionality for IIS. <p>I hope this helps!</p>]]></content:encoded>
    </item>
    <item>
      <title>Running IIS Express on a Random Port</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/running-iis-express-on-a-random-port</link>
      <pubDate>Wed, 21 Mar 2018 23:30:07 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/?p=1995</guid>
      <description><![CDATA[I have found myself using IIS Express for a bunch of web projects these days, and each of these...]]></description>
      <content:encoded><![CDATA[<p>I have found myself using <a href="https://docs.microsoft.com/en-us/iis/extensions/introduction-to-iis-express/" target="_blank">IIS Express</a> for a bunch of web projects these days, and each of these projects is using different frameworks and different authoring systems. (Like Windows Notepad, which is still the one of the world's most-used code editors.)</p> <p>Anyway, there are many times when I need multiple copies of IIS Express running at the same time on my development computer, and common sense would dictate that I would create a custom batch file for each website with the requisite parameters. To be honest, for a very long time that's exactly how I set things up; each development site got a custom batch file with the path to the content and a unique port specified. For example:</p> <p style="color: #000;margin-left: 20px;background-color: #fff"><tt>@echo off<br>iisexpress.exe /path:c:\inetpub\website1\wwwroot /port:8000</tt></p> <p>The trouble is, after a while I had so many batch files created that I could never remember which ports I had already used. However, if you don't specify a port, IIS Express will always fall back on the default port of 8080. What this means is, my first IIS Express command would work like the example shown below:</p> <p style="color: #000;margin-left: 20px;background-color: #fff"><tt>CMD&gt; iisexpress.exe /path:c:\inetpub\website1\wwwroot<br><br>Copied template config file 'C:\Program Files\IIS Express\AppServer\applicationhost.config' to 'C:\Users\joecool\AppData\Local\Temp\iisexpress\applicationhost2018321181518842.config'<br>Updated configuration file 'C:\Users\joecool\AppData\Local\Temp\iisexpress\applicationhost2018321181518842.config' with given cmd line info.<br>Starting IIS Express ...<br>Successfully registered URL "http://localhost:8080/" for site "Development Web Site" application "/"<br>Registration completed<br>IIS Express is running.<br>Enter 'Q' to stop IIS Express</tt></p> <p>But my second IIS Express command would fail like the example shown below:</p> <p style="color: #000;margin-left: 20px;background-color: #fff"><tt>CMD&gt; iisexpress.exe /path:c:\inetpub\website2\wwwroot<br><br>Copied template config file 'C:\Program Files\IIS Express\AppServer\applicationhost.config' to 'C:\Users\joecool\AppData\Local\Temp\iisexpress\applicationhost2018321181545562.config'<br>Updated configuration file 'C:\Users\joecool\AppData\Local\Temp\iisexpress\applicationhost2018321181545562.config' with given cmd line info.<br>Starting IIS Express ...<br><span style="color: #800">Failed to register URL "http://localhost:8080/" for site "Development Web Site" application "/". Error description: Cannot create a file when that file already exists. (0x800700b7)</span><br>Registration completed<br>Unable to start iisexpress.<br><br><span style="color: #800">Cannot create a file when that file already exists.<br>For more information about the error, run iisexpress.exe with the tracing switch enabled (/trace:error).</span></tt></p> <p>I began to think that I was going to need to keep a spreadsheet with all of my paths and ports listed in it, when I realized that what I <em>really</em> needed was a common, generic batch file that would suit my needs for <em>all</em> of my development websites - with no customization <em>at all</em>.</p> <p>Here is the batch file that I wrote, which I called "<strong>IISEXPRESS-START.cmd</strong>", and I will explain what it does after the code listing:</p> <p style="color: #000;margin-left: 20px;background-color: #fff"><tt>@echo off<br><br>pushd "%~dp0"<br><br>setlocal enabledelayedexpansion<br><br>if exist "wwwroot" (<br>if exist "%ProgramFiles%\IIS Express\iisexpress.exe" (<br>&nbsp; set /a RNDPORT=8000 + %random% %%1000<br>&nbsp; "%ProgramFiles%\IIS Express\iisexpress.exe" /path:"%~dp0wwwroot" /port:!RNDPORT!<br>)<br>) <br><br>popd</tt></p> <p>Here's what the respective lines in the batch file are doing:</p> <ol> <li>Push the folder where the batch file is being run on the stack; this is a cool little hack that also allows running the batch file in a folder on a network share and still have it work.  <li>Enable delayed expansion of variables; this ensures that variables would work inside of conditional code blocks.  <li>Check to see if there is a subfolder named "wwwroot" under the batch file's path; this is optional, but it helps things run smoothly. (I'll explain more about that below.)  <li>Check to make sure that IIS Express is installed in the correct place  <li>Configure a local variable with a random port number between 8000 and 8999; you can see that it uses modulus division to force the random port into the desired range.  <li>Start IIS Express by passing the path to the child "wwwroot" folder and the random port number. </li></ol> <p>One last piece of explanation: I almost always use a "wwwroot" folder under each parent folder for a website, with the goal of managing most of the parts of each website in one place. With that in mind, I tend to create folder hierarchies like the following example:</p> <ul> <li>C:  <ul> <li>Production  <ul> <li>Website1  <ul> <li>wwwroot </li></ul> <li>Website2  <ul> <li>ftproot  <li>wwwroot </li></ul> <li>Website3  <ul> <li>wwwdata  <li>wwwroot </li></ul></li></ul> <li>Staging  <ul> <li>Website1  <ul> <li>wwwroot </li></ul> <li>Website2  <ul> <li>ftproot  <li>wwwroot </li></ul> <li>Website3  <ul> <li>wwwdata  <li>wwwroot </li></ul></li></ul></li></ul></li></ul> <p>Using this structure, I can drop the batch file listed in this blog into any of those Website1, Website2, Website3 folders and it will "just work."</p>]]></content:encoded>
    </item>
    <item>
      <title>Simple Java Wrapper Class for raspistill on the Raspberry Pi 2</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/simple-java-wrapper-class-for-raspistill-on-the-raspberry-pi-2</link>
      <pubDate>Fri, 12 Jun 2015 03:14:00 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2015/06/12/simple-java-wrapper-class-for-raspistill-on-the-raspberry-pi-2/</guid>
      <description><![CDATA[Like many self-proclaimed geeks, I can't resist a change to play with new technology. So when the...]]></description>
      <content:encoded><![CDATA[<p>Like many self-proclaimed geeks, I can't resist a change to play with new technology. So when the <a href="https://www.raspberrypi.org/" target="_blank">Raspberry Pi 2</a> was released a short time ago, I didn't hesitate buying one. My first impressions was: for $35, that's a lot of computer power in a very small package. And because I really <em>am</em> a geek, I will admit that the first thing I tried to do with it was to install DOSBOX and run <a href="https://en.wikipedia.org/wiki/History_of_Microsoft_Flight_Simulator" target="_blank">Microsoft Flight Simulator 4</a>.</p>
<p>Once I got that out of my system, I started experimenting with some simple Java programming and the <a href="https://www.raspberrypi.org/products/camera-module/" target="_blank">Raspberry Pi camera module</a>. (It's great that Java is built-into Raspian Wheezy; in the past you had to install it.)</p>
<p>That being said, there isn't any direct I/O control of the camera via Java, although that's pretty much expected. When considering ways to control the camera I came across the <a href="http://pi4j.com/" target="_blank">Pi4J library</a>, which provides Java-based APIs to control the Raspberry Pi's I/O. This looks like it will be great for me eventually, but for the moment the best idea that I could come up with was to write a simple Java-based wrapper class for the <a href="https://www.raspberrypi.org/documentation/raspbian/applications/camera.md" target="_blank">raspistill</a> command line executable.</p>
<p>With that in mind, here's a sample class that you can use to take photos from Java on a Raspberry Pi. I added lots of code comments to explain how everything works, and I'll provide a little more detail after the code sample.</p>
<pre style="color: black; margin-left: 20px; background-color: #ffffff;"><span style="color: #008000;">// This class is a very simple Java wrapper for the raspistill executable,</span>
<span style="color: #008000;">// which makes it easier to take photos from a Java application. Note that</span>
<span style="color: #008000;">// there are considerably more parameters available for raspistill which</span>
<span style="color: #008000;">// could be added to this class. (e.g. Shutter Speed, ISO, AWB, etc.) </span>

<span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> RaspiStill
{
   <span style="color: #008000;">// Define the path to the raspistill executable.</span>
   <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">final</span> String _raspistillPath = <span style="color: #800000;">"/opt/vc/bin/raspistill"</span>;
   <span style="color: #008000;">// Define the amount of time that the camera will use to take a photo.</span>
   <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">final</span> <span style="color: #0000ff;">int</span> _picTimeout = 5000;
   <span style="color: #008000;">// Define the image quality.</span>
   <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">final</span> <span style="color: #0000ff;">int</span> _picQuality = 100;

   <span style="color: #008000;">// Specify a default image width.</span>
   <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">int</span> _picWidth = 1024;
   <span style="color: #008000;">// Specify a default image height.</span>
   <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">int</span> _picHeight = 768;
   <span style="color: #008000;">// Specify a default image name.</span>
   <span style="color: #0000ff;">private</span> String _picName = <span style="color: #800000;">"example.jpg"</span>;
   <span style="color: #008000;">// Specify a default image encoding.</span>
   <span style="color: #0000ff;">private</span> String _picType = <span style="color: #800000;">"jpg"</span>;

   <span style="color: #008000;">// Default class constructor.</span>
   <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> RaspiStill()
   {
      <span style="color: #008000;">// Do anything else here. For example, you could create another</span>
      <span style="color: #008000;">// constructor which accepts an alternate path to raspistill,</span>
      <span style="color: #008000;">// or defines global parameters like the image quality.</span>
   }

   <span style="color: #008000;">// Default method to take a photo using the private values for name/width/height.</span>
   <span style="color: #008000;">// Note: See the overloaded methods to override the private values.</span>
   <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> TakePicture()
   {
      <span style="color: #0000ff;">try</span>
      {
         <span style="color: #008000;">// Determine the image type based on the file extension (or use the default).</span>
         <span style="color: #0000ff;">if</span> (_picName.indexOf(<span style="color: #800000;">'.'</span>)!=-1) _picType = _picName.substring(_picName.lastIndexOf(<span style="color: #800000;">'.'</span>)+1);

         <span style="color: #008000;">// Create a new string builder with the path to raspistill.</span>
         StringBuilder sb = <span style="color: #0000ff;">new</span> StringBuilder(_raspistillPath);

         <span style="color: #008000;">// Add parameters for no preview and burst mode.</span>
         sb.append(<span style="color: #800000;">" -n -bm"</span>);
         <span style="color: #008000;">// Configure the camera timeout.</span>
         sb.append(<span style="color: #800000;">" -t "</span> + _picTimeout);
         <span style="color: #008000;">// Configure the picture width.</span>
         sb.append(<span style="color: #800000;">" -w "</span> + _picWidth);
         <span style="color: #008000;">// Configure the picture height.</span>
         sb.append(<span style="color: #800000;">" -h "</span> + _picHeight);
         <span style="color: #008000;">// Configure the picture quality.</span>
         sb.append(<span style="color: #800000;">" -q "</span> + _picQuality);
         <span style="color: #008000;">// Specify the image type.</span>
         sb.append(<span style="color: #800000;">" -e "</span> + _picType);
         <span style="color: #008000;">// Specify the name of the image.</span>
         sb.append(<span style="color: #800000;">" -o "</span> + _picName);

         <span style="color: #008000;">// Invoke raspistill to take the photo.</span>
         Runtime.getRuntime().exec(sb.toString());
         <span style="color: #008000;">// Pause to allow the camera time to take the photo.</span>
         Thread.sleep(_picTimeout);
      }
      <span style="color: #0000ff;">catch</span> (Exception e)
      {
         <span style="color: #008000;">// Exit the application with the exception's hash code.</span>
         System.exit(e.hashCode());
      }
   }

   <span style="color: #008000;">// Overloaded method to take a photo using specific values for the name/width/height.</span>
   <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> TakePicture(<span style="color: #0000ff;">String</span> name, <span style="color: #0000ff;">int</span> width, <span style="color: #0000ff;">int</span> height)
   {
      _picName = name;
      _picWidth = width;
      _picHeight = height;
      TakePicture();
   }

   <span style="color: #008000;">// Overloaded method to take a photo using a specific value for the image name.</span>
   <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> TakePicture(<span style="color: #0000ff;">String</span> name)
   {
      TakePicture(name, _picWidth, _picHeight);
   }

   <span style="color: #008000;">// Overloaded method to take a photo using specific values for width/height.</span>
   <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">void</span> TakePicture(<span style="color: #0000ff;">int</span> width, <span style="color: #0000ff;">int</span> height)
   {
      TakePicture(_picName, width, height);
   }
}</pre>
<p>The wrapper class should be pretty self-explanatory: calling the TakePicture() method with no parameters will use the application defaults, and calling the overloaded methods will allow you to specify the output filename and the width/height for the image. You specify the image type based on the file extension; (e.g. ".jpg", ".png", ".gif"). There are a bunch of additional raspistill options which you can easily add to the application; see the <a href="https://www.raspberrypi.org/products/camera-module/" target="_blank">Raspberry Pi camera module</a> page for more information.</p>
<p>Here's a simple application to test it out:</p>
<pre style="color: black; margin-left: 20px; background-color: #ffffff;"><span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> CameraTest
{
  <span style="color: #008000;">// Define the number of photos to take.</span>
  <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">final</span> <span style="color: #0000ff;">long</span> _numberOfImages = 5;
  <span style="color: #008000;">// Define the interval between photos.</span>
  <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">final</span> <span style="color: #0000ff;">int</span> _delayInterval = 5000;

  <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> main(String[] args)
  {
    <span style="color: #0000ff;">try</span>
    {
      <span style="color: #008000;">// Create a new RaspiStill object.</span>
      RaspiStill camera = <span style="color: #0000ff;">new</span> RaspiStill();
      <span style="color: #008000;">// Loop through the number of images to take.</span>
      <span style="color: #0000ff;">for</span> (<span style="color: #0000ff;">long</span> i = 0; i &lt; _numberOfImages; ++i)
      {
        <span style="color: #008000;">// Capture the image.</span>
        camera.TakePicture(<span style="color: #800000;">"image"</span> + i + <span style="color: #800000;">".jpg"</span>,800,600);
        <span style="color: #008000;">// Pause after each photo.</span>
        Thread.sleep(_delayInterval);
      }
    }
    <span style="color: #0000ff;">catch</span> (Exception e)
    {
      <span style="color: #008000;">// Exit the application with the exception's hash code.</span>
      System.exit(e.hashCode());
    }
  }
}</pre>
<p>Now that I've shared this odd little sample, I'll wander back to my dungeon so I can keep playing with my Raspberry Pi.</p>]]></content:encoded>
    </item>
    <item>
      <title>Follow Up: Converting Text Files to Audio Files</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/follow-up-converting-text-files-to-audio-files</link>
      <pubDate>Fri, 29 May 2015 02:59:29 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2015/05/29/follow-up-converting-text-files-to-audio-files/</guid>
      <description><![CDATA[A couple of days ago I posted a blog which I titled Creating an HTML Application to Convert Text...]]></description>
      <content:encoded><![CDATA[<p>A couple of days ago I posted a blog which I titled <em><a href="http://blogs.msdn.com/b/robert_mcmurray/archive/2015/05/27/creating-an-html-application-to-convert-text-files-to-audio-files.aspx" target="_blank">Creating an HTML Application to Convert Text Files to Audio Files</a></em>, in which I showed how to create an HTML Application that will convert a text file to an audio file. I thought that I would follow up that article with a quick demonstration which compares some of the built-in text-to-speech voices that ship with Windows 7 and Windows 8.</p>  <p>For the text in this demonstration I will use <a href="http://en.wikipedia.org/wiki/The_Raven" target="_blank">Edgar Allan Poe's famous poem titled The Raven</a><em></em>, which is one of my personal favorites. (I used to have the poem memorized as a teenager... that might have been when I was going through a <a href="http://en.wikipedia.org/wiki/Fahrenheit_451" target="_blank"><em>Fahrenheit 451</em></a> phase.)</p>  <table style="border-top-style: none; border-bottom-style: none; border-right-style: none; margin-left: 20px; border-left-style: none"><tbody>     <tr>       <td style="text-align: center"><a href="http://www.microsoftbob.com/file.axd?file=2015%2f05%2fText-To-Wave-Edgar-Allan-Poe-The-Raven.txt" target="_blank"><img style="border-top-style: none; height: 128px; width: 128px; border-bottom-style: none; border-right-style: none; border-left-style: none" src="https://5bkbpa.dm2303.livefilestore.com/y2pnKmDZEPBMZS-FHzHehHQOzVlDb5WYgcirj0lA_v7N7lO_BuSo9PsZzYcY_ERCECvL3YkYeznsy1ECq_--PsuBvnE4OnOqFLXrmaj7YrHNqFrH84ZmFVz2JC3RascPelW3ViLqRm0Fzj5xmT3fPPD1MbtiRcwe35NS8ZZy1ZEpQE/TXT.png" /></a></td>     </tr>      <tr>       <td style="text-align: center"><em>Click the above image            <br />to download the text file.</em></td>     </tr>   </tbody></table>  <h3>Microsoft Anna (Windows 7)</h3>  <p>For the first demo we will take a look at the poem as read by the <em>Microsoft Anna</em> text-to-speech voice, which ships with Windows 7. This voice is acceptable, and certainly better than the text-to-speech voices which shipped before Windows 7 was released. But still, it has a few odd quirks to it, and as a result this voice typically sounds unnatural to me.</p>  <table style="border-top-style: none; border-bottom-style: none; border-right-style: none; margin-left: 20px; border-left-style: none"><tbody>     <tr>       <td style="text-align: center"><a href="http://www.microsoftbob.com/file.axd?file=2015%2f05%2fText-To-Wave-Edgar-Allan-Poe-The-Raven-Anna.mp3" target="_blank"><img style="border-top-style: none; height: 128px; width: 128px; border-bottom-style: none; border-right-style: none; border-left-style: none" src="https://5bkbpa.dm2303.livefilestore.com/y2pkryUSq_TBQPkV36oNGMAfsTI2q6jSkCjMWka2jtHHfzvDGLpKgTWyV3jwZ4fWBZSYgx8sB5s9gmUEuCchRcCGZ3pAkj-Sm7OnxXuMCum7VxDjPoz5GKQvxSeYDXRjbOqEpwBLl0IywLCuoWvpNNqlbw-XVSa0ilETTyfHtSzSCU/MP3.png" /></a></td>     </tr>      <tr>       <td style="text-align: center"><em>Click the above image            <br />to download the MP3 file.</em></td>     </tr>   </tbody></table>  <h3>Microsoft David (Windows 8)</h3>  <p>For the second demo we will take a look at the poem as read by the <em>Microsoft David</em> text-to-speech voice, which ships with Windows 8. This voice is considerably more acceptable that <em>Microsoft Anna</em>, and it sounds very natural to me. It is obviously a male voice, and several people with whom I have discussed this subject seem to prefer the <em>Microsoft David</em> voice over all the others.</p>  <table style="border-top-style: none; border-bottom-style: none; border-right-style: none; margin-left: 20px; border-left-style: none"><tbody>     <tr>       <td style="text-align: center"><a href="http://www.microsoftbob.com/file.axd?file=2015%2f05%2fText-To-Wave-Edgar-Allan-Poe-The-Raven-David.mp3" target="_blank"><img style="border-top-style: none; height: 128px; width: 128px; border-bottom-style: none; border-right-style: none; border-left-style: none" src="https://5bkbpa.dm2303.livefilestore.com/y2pkryUSq_TBQPkV36oNGMAfsTI2q6jSkCjMWka2jtHHfzvDGLpKgTWyV3jwZ4fWBZSYgx8sB5s9gmUEuCchRcCGZ3pAkj-Sm7OnxXuMCum7VxDjPoz5GKQvxSeYDXRjbOqEpwBLl0IywLCuoWvpNNqlbw-XVSa0ilETTyfHtSzSCU/MP3.png" /></a></td>     </tr>      <tr>       <td style="text-align: center"><em>Click the above image            <br />to download the <em>MP3 </em>file.</em></td>     </tr>   </tbody></table>  <h3>Microsoft Hazel (Windows 8)</h3>  <p>For the third demo we will take a look at the poem as read by the <em>Microsoft Hazel</em> text-to-speech voice, which also ships with Windows 8. This also much better than the text-to-speech voices which shipped before Windows 7, and it has an English accent which makes it fun for converting literary works.</p>  <table style="border-top-style: none; border-bottom-style: none; border-right-style: none; margin-left: 20px; border-left-style: none"><tbody>     <tr>       <td style="text-align: center"><a href="http://www.microsoftbob.com/file.axd?file=2015%2f05%2fText-To-Wave-Edgar-Allan-Poe-The-Raven-Hazel.mp3" target="_blank"><img style="border-top-style: none; height: 128px; width: 128px; border-bottom-style: none; border-right-style: none; border-left-style: none" src="https://5bkbpa.dm2303.livefilestore.com/y2pkryUSq_TBQPkV36oNGMAfsTI2q6jSkCjMWka2jtHHfzvDGLpKgTWyV3jwZ4fWBZSYgx8sB5s9gmUEuCchRcCGZ3pAkj-Sm7OnxXuMCum7VxDjPoz5GKQvxSeYDXRjbOqEpwBLl0IywLCuoWvpNNqlbw-XVSa0ilETTyfHtSzSCU/MP3.png" /></a></td>     </tr>      <tr>       <td style="text-align: center"><em>Click the above image            <br />to download the <em>MP3 </em>file.</em></td>     </tr>   </tbody></table>  <h3>Microsoft Zira (Windows 8)</h3>  <p>For the fourth and final demo we will take a look at the poem as read by the <em>Microsoft Zira</em> text-to-speech voice, which also ships with Windows 8. This voice is my personal favorite, as I find it the most-natural sounding of all the text-to-speech voices which ship with Windows 7; this is the voice that I used for all of my textbook reading assignments.</p>  <table style="border-top-style: none; border-bottom-style: none; border-right-style: none; margin-left: 20px; border-left-style: none"><tbody>     <tr>       <td style="text-align: center"><a href="http://www.microsoftbob.com/file.axd?file=2015%2f05%2fText-To-Wave-Edgar-Allan-Poe-The-Raven-Zira.mp3" target="_blank"><img style="border-top-style: none; height: 128px; width: 128px; border-bottom-style: none; border-right-style: none; border-left-style: none" src="https://5bkbpa.dm2303.livefilestore.com/y2pkryUSq_TBQPkV36oNGMAfsTI2q6jSkCjMWka2jtHHfzvDGLpKgTWyV3jwZ4fWBZSYgx8sB5s9gmUEuCchRcCGZ3pAkj-Sm7OnxXuMCum7VxDjPoz5GKQvxSeYDXRjbOqEpwBLl0IywLCuoWvpNNqlbw-XVSa0ilETTyfHtSzSCU/MP3.png" /></a></td>     </tr>      <tr>       <td style="text-align: center"><em>Click the above image            <br />to download the <em>MP3 </em>file.</em></td>     </tr>   </tbody></table>  <h3>In Closing</h3>  <p>As a parting thought, the text-to-speech voices which ship with Windows 8 are extremely good in my opinion; they sound very natural, and they are very easy to understand. As a result, I have a tendency to speed up the playback a little when I am using the script which I shared in my previous blog. That being said, I hope these samples help to demonstrate the various text-to-speech voices that are available in the recent versions of Windows.</p>]]></content:encoded>
    </item>
    <item>
      <title>Creating an HTML Application to Convert Text Files to Audio Files</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/creating-an-html-application-to-convert-text-files-to-audio-files</link>
      <pubDate>Wed, 27 May 2015 15:18:40 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2015/05/27/creating-an-html-application-to-convert-text-files-to-audio-files/</guid>
      <description><![CDATA[I'd like to take a brief departure from my normal collage of web-related and server-management...]]></description>
      <content:encoded><![CDATA[<p>I'd like to take a brief departure from my normal collage of web-related and server-management examples and share a rather eclectic code sample.</p>  <p>Here's the scenario: I am presently working on another college degree, and I was recently taking a class which required a great deal of reading.&#160; These assignments were all in digital form: I was using PDF or Kindle-based versions of the textbooks, and the remaining reading consisted of online articles. However, I am also an avid bicyclist, and the voluminous amount of reading was preventing me from going on some of my normal weekly rides. This gave me an idea: if I could convert the digital text to audio, I could bring my assignments with me on my longer rides and have my MP3 player read my assignments to me as I pedaled my way around the Arizona deserts.</p>  <p>I had experimented with Microsoft's built-in text-to-speech features some years ago, so I thought that this would be the perfect opportunity to revisit some of those APIs and write a full application to do the conversions for me. That being said, I could have written this application by using C# (which is my preferred language), but I decided to create an HTML Application for two reasons: 1) it is easier for me to share HTMLA applications in a blog, and 2) I keep this application in my OneDrive, so it's easier for me to modify the source code on systems where I don't have Visual Studio installed.</p>  <p>With that in mind, here is the resulting script which will convert a Text File to a Wave (*.WAV) File.</p>  <h3>Using the HTML Application</h3>  <p>As with most of my HTML Applications, the user interface is pretty simple to use; when you double click the HTA file, it will present you with the following user interface:</p>  <p style="margin-left: 20px"><img style="height: 135px; width: 555px" src="https://1kztfw.dm2303.livefilestore.com/y2pLVcbeAjK6-UkJwTeCB8IQZaVOnIBwYjJEY888SYkOe-JWDK8cz0JrXH4Sth80jgWaitrYrQPEA_0XgAIjuIxC_PluBUerylnKTsoVa251RPppfTfPetG65eqzkLQzxbcvC0i7iAefSG4UmQm3xh_fStvGyb3XuMjoJMUjW7JLW4/Text-To-Wave-File-UI-1.png" /></p>  <p>Clicking the <strong>Browse</strong> button will obviously allow you to browse to a text file, clicking the <strong>Close</strong> button will close the application, and clicking the <strong>Write File</strong> button will create a Wave file that is in the same path as the source text file. For example, if you have a text file at &quot;<em>C:\Text\Test.txt</em>&quot;, the script will create a Wave file at &quot;<em>C:\Text\Test.txt.wav</em>&quot;. </p>  <p>That being said, there are a few options which you can set:</p>  <ul>   <li style="line-height: 200%">Depending on your version of Windows and which languages you have installed, you will be presented with a list of available voices in the first drop-down menu; the following example is from a Windows 8 computer:      <br /><img style="height: 135px; width: 555px" src="https://1kztfw.dm2303.livefilestore.com/y2pgrc8dcqhHmppQ1TAY72PiNr-fkP_2sZJctFqcUthvm4_2p2Iw-EVAZ7a3Cb-ZMgkGzygReF6fCLqt7G9u-VzvtAWaWhV89dLOXgvBfyKJnSxZFjqLJbs3fgRljGkzSJo4VZqkLUTRyhL00KNjx0wPcLSzpkvr1K3KSjg9Y5UotQ/Text-To-Wave-File-UI-2.png" /> </li>    <li style="line-height: 200%">The second drop-down menu allows you to vary the playback speed; sometimes I prefer the playback speed to be slighter faster than normal:      <br /><img style="height: 135px; width: 555px" src="https://1kztfw.dm2303.livefilestore.com/y2pYGm8vBAuN-DhyYZHk8734MSoo1EImrpjeNCCQ2JpO2mC-HMp1oSpsdyZU6-2FMQOMgpyk55P_w0MFNCadbyfty8rEZA4Ttgz3E9dT4_V04Tam9pQZcGLwZmmyYQOOx-t67DFAbgMQnLLe1ZLvWJbqEniNfDNYHN8lT7fUz6HxDk/Text-To-Wave-File-UI-3.png" /> </li>    <li style="line-height: 200%">The third drop-down menu allows you to alter the volume of the resulting Wave file:      <br /><img style="height: 135px; width: 555px" src="https://1kztfw.dm2303.livefilestore.com/y2pv9i5pdxpV77y5Tn4fNVkcZjYKAEolvYOIE7UN4qtFoF6nCM-4MsRPvNCntUgtHMcgnU1xhYs3jIYMLFxOF7Vt_H8m4DwfFatB_VLWL8oVAKaDboxKp_TnsNgMBBKyl_r7qhGXkgKwsn2V8YbAtrrIH0ANqfEmvp5PPUSq3VvQU0/Text-To-Wave-File-UI-4.png" /> </li> </ul>  <p>Note: You can modify the script to alter the values that are used in the playback speed and volume drop-down menus, but the list of voices is obtained dynamically from your operating system.</p>  <h3>Creating the HTML Application</h3>  <p>To create this HTML Application, save the following HTMLA code as &quot;Text to Wave File.hta&quot; to your computer, and then double-click its icon to run the application. (Note that in a few places I added code comments which contain the MSDN URL for the APIs that I am using for this sample.)</p>  <pre style="color: black; margin-left: 20px; background-color: #ffffff"><span style="color: #0000ff">&lt;</span><span style="color: #800000">html</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;</span><span style="color: #800000">head</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;</span><span style="color: #800000">title</span><span style="color: #0000ff">&gt;</span>Text-to-Speech Writer<span style="color: #0000ff">&lt;/</span><span style="color: #800000">title</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;</span><span style="color: #800000">HTA:APPLICATION</span>
  <span style="color: #ff0000">APPLICATIONNAME</span><span style="color: #0000ff">=&quot;Text-to-Speech Writer&quot;</span>
  <span style="color: #ff0000">ID</span><span style="color: #0000ff">=&quot;TextToSpeech&quot;</span>
  <span style="color: #ff0000">VERSION</span><span style="color: #0000ff">=&quot;1.0&quot;</span>
  <span style="color: #ff0000">BORDER</span><span style="color: #0000ff">=&quot;dialog&quot;</span>
  <span style="color: #ff0000">BORDERSTYLE</span><span style="color: #0000ff">=&quot;static&quot;</span>
  <span style="color: #ff0000">INNERBORDER</span><span style="color: #0000ff">=&quot;no&quot;</span>
  <span style="color: #ff0000">CAPTION</span><span style="color: #0000ff">=&quot;yes&quot;</span>
  <span style="color: #ff0000">SYSMENU</span><span style="color: #0000ff">=&quot;no&quot;</span>
  <span style="color: #ff0000">MAXIMIZEBUTTON</span><span style="color: #0000ff">=&quot;no&quot;</span>
  <span style="color: #ff0000">MINIMIZEBUTTON</span><span style="color: #0000ff">=&quot;no&quot;</span>
  <span style="color: #ff0000">SCROLL</span><span style="color: #0000ff">=&quot;no&quot;</span>
  <span style="color: #ff0000">SCROLLFLAT</span><span style="color: #0000ff">=&quot;yes&quot;</span>
  <span style="color: #ff0000">SINGLEINSTANCE</span><span style="color: #0000ff">=&quot;yes&quot;</span>
  <span style="color: #ff0000">CONTEXTMENU</span><span style="color: #0000ff">=&quot;no&quot;</span>
  <span style="color: #ff0000">SELECTION</span><span style="color: #0000ff">=&quot;no&quot;/&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #800000">head</span><span style="color: #0000ff">&gt;</span>

<span style="color: #0000ff">&lt;</span><span style="color: #800000">script</span> <span style="color: #ff0000">language</span><span style="color: #0000ff">=&quot;VBScript&quot;&gt;</span>

<span style="color: #0000ff">Option Explicit</span>

<span style="color: #0000ff">Dim</span> blnCancelBubble

<span style="color: #008000">' ----------------------------------------</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' OnLoad event handler for the application.</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' ----------------------------------------</span>

<span style="color: #0000ff">Sub</span> Window_OnLoad
  blnCancelBubble = <span style="color: #0000ff">False</span>
  <span style="color: #008000">' Set up the UI dimensions.</span>
  <span style="color: #0000ff">Const</span> intDialogWidth = 550
  <span style="color: #0000ff">Const</span> intDialogHeight = 125
  <span style="color: #008000">' Specify the window position and size.</span>
  Self.resizeTo intDialogWidth,intDialogHeight
  Self.moveTo (Screen.AvailWidth - intDialogWidth) / 2,_
    (Screen.AvailHeight - intDialogHeight) / 2
  <span style="color: #008000">' Load the list of text-to-speech voices into the drop-down menu.</span>
  <span style="color: #008000">' See the notes in WriteFile() for more information.</span>
  <span style="color: #0000ff">Dim</span> objSAPI, objVoice, objSelect, objOption
  <span style="color: #0000ff">Set</span> objSAPI = CreateObject(<span style="color: #800000">&quot;SAPI.SpVoice&quot;</span>)
  <span style="color: #0000ff">For</span> <span style="color: #0000ff">Each</span> objVoice <span style="color: #0000ff">In</span> objSAPI.GetVoices(<span style="color: #800000">&quot;&quot;</span>,<span style="color: #800000">&quot;&quot;</span>)
    <span style="color: #0000ff">Set</span> objSelect = Document.getElementById(<span style="color: #800000">&quot;optVoices&quot;</span>)
    <span style="color: #0000ff">Set</span> objOption = Document.createElement(<span style="color: #800000">&quot;option&quot;</span>)
    objOption.text = objVoice.GetDescription() 
    objSelect.Add objOption
  <span style="color: #0000ff">Next</span>
<span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span>

<span style="color: #008000">' ----------------------------------------</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' Click handler for the Write button.</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' ----------------------------------------</span>

<span style="color: #0000ff">Sub</span> btnWrite_OnClick()
  <span style="color: #008000">' Test for a file name.</span>
  <span style="color: #0000ff">If</span> Len(txtFile.Value) &gt; 0 <span style="color: #0000ff">Then</span>
    <span style="color: #008000">' Test if we need to cancel bubbling of events.</span>
    <span style="color: #0000ff">If</span> blnCancelBubble = <span style="color: #0000ff">False</span> <span style="color: #0000ff">Then</span>
        <span style="color: #008000">' Write the input file.</span>
        <span style="color: #0000ff">Call</span> WriteFile(txtFile.Value)
      <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span>
    <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span>
    <span style="color: #008000">' Specify whether to bubble events.</span>
    blnCancelBubble = IIf(blnCancelBubble=<span style="color: #0000ff">True</span>,<span style="color: #0000ff">False</span>,<span style="color: #0000ff">True</span>)
<span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span>

<span style="color: #008000">' ----------------------------------------</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' Change handler for the input box.</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' ----------------------------------------</span>

<span style="color: #0000ff">Sub</span> txtFile_OnChange()
  <span style="color: #008000">' Enable the Write button.</span>
  btnWrite.Disabled = <span style="color: #0000ff">False</span>
  <span style="color: #008000">' Enable event bubbling.</span>
  blnCancelBubble = <span style="color: #0000ff">False</span>
<span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span>

<span style="color: #008000">' ----------------------------------------</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' Click handler for the Close button.</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' ----------------------------------------</span>

<span style="color: #0000ff">Sub</span> btnClose_OnClick()
  <span style="color: #008000">' Test if we need to cancel bubbling of events.</span>
  <span style="color: #0000ff">If</span> blnCancelBubble = <span style="color: #0000ff">False</span> <span style="color: #0000ff">Then</span>
    <span style="color: #008000">' Prompt the user to exit.</span>
    <span style="color: #0000ff">If</span> MsgBox(<span style="color: #800000">&quot;Are you sure you wish to exit?&quot;</span>, _
      vbYesNo+vbDefaultButton2+vbQuestion+vbSystemModal, _
      TextToSpeech.applicationName)=vbYes <span style="color: #0000ff">Then</span>
      <span style="color: #008000">' Enable event bubbling.</span>
      blnCancelBubble = <span style="color: #0000ff">True</span>
      <span style="color: #008000">' Close the application.</span>
      Window.close
    <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span>
  <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span>
  <span style="color: #008000">' Specify whether to bubble events.</span>
     blnCancelBubble = IIf(blnCancelBubble=<span style="color: #0000ff">True</span>,<span style="color: #0000ff">False</span>,<span style="color: #0000ff">True</span>)
<span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span>

<span style="color: #008000">' ----------------------------------------</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' This is an ultra-lame workaround for the lack</span>
<span style="color: #008000">' of a DoEvents() feature in HTA applications.</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' ----------------------------------------</span>

<span style="color: #0000ff">Sub</span> DoEvents()
  <span style="color: #0000ff">On</span> <span style="color: #0000ff">Error</span> <span style="color: #0000ff">Resume</span> <span style="color: #0000ff">Next</span>
  <span style="color: #008000">' Create a shell object.</span>
  <span style="color: #0000ff">Dim</span> objShell : <span style="color: #0000ff">Set</span> objShell = CreateObject(<span style="color: #800000">&quot;Wscript.Shell&quot;</span>)
  <span style="color: #008000">' Call out to the shell and essentially do nothing.</span>
  objShell.Run <span style="color: #800000">&quot;ver&quot;</span>, 0, <span style="color: #0000ff">True</span>
<span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span>

<span style="color: #008000">' ----------------------------------------</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' This is an ultra-lame workaround for the lack</span>
<span style="color: #008000">' of an IIf() function in vbscript applications.</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' ----------------------------------------</span>

<span style="color: #0000ff">Function</span> IIf(tx,ty,tz)
  <span style="color: #0000ff">If</span> (tx) <span style="color: #0000ff">Then</span> IIf = ty <span style="color: #0000ff">Else</span> IIf = tz
<span style="color: #0000ff">End</span> <span style="color: #0000ff">Function</span>

<span style="color: #008000">' ----------------------------------------</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' Main text-to-speech function</span>
<span style="color: #008000">' </span>
<span style="color: #008000">' ----------------------------------------</span>

<span style="color: #0000ff">Sub</span> WriteFile(strInputFileName)
  <span style="color: #0000ff">On</span> <span style="color: #0000ff">Error</span> <span style="color: #0000ff">Resume</span> <span style="color: #0000ff">Next</span>
  <span style="color: #0000ff">Dim</span> objFSO
  <span style="color: #0000ff">Dim</span> objFile
  <span style="color: #0000ff">Dim</span> objSAPI
  <span style="color: #0000ff">Dim</span> objFileStream
  <span style="color: #0000ff">Dim</span> strOldTitle
  <span style="color: #0000ff">Dim</span> strOutputFilename
  <span style="color: #0000ff">Const</span> strProcessing = <span style="color: #800000">&quot;Creating WAV file... &quot;</span>
  
  <span style="color: #008000">' Define the audio format as 44.1kHz / 16-bit audio.</span>
  <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms720595.aspx</span>
  <span style="color: #0000ff">Const</span> SAFT44kHz16BitStereo = 35
  <span style="color: #008000">' Allow text to be read as well as written.</span>
  <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms720858.aspx</span>
  <span style="color: #0000ff">Const</span> SSFMCreateForWrite = 3
  
  <span style="color: #008000">' Define the output WAV filename.</span>
  strOutputFilename = strInputFileName &amp; <span style="color: #800000">&quot;.wav&quot;</span>

  <span style="color: #008000">' Create a file system object and open the input file.</span>
  <span style="color: #0000ff">Set</span> objFSO = CreateObject(<span style="color: #800000">&quot;Scripting.FileSystemObject&quot;</span>)
  <span style="color: #0000ff">Set</span> objFile = objFSO.OpenTextFile(strInputFileName, 1)
  
  <span style="color: #008000">' Disable the form fields.</span>
  optVoices.Disabled = <span style="color: #0000ff">True</span>
  optRate.Disabled = <span style="color: #0000ff">True</span>
  optVolume.Disabled = <span style="color: #0000ff">True</span>
  txtFile.Disabled = <span style="color: #0000ff">True</span>
  btnWrite.Disabled = <span style="color: #0000ff">True</span>
  btnClose.Value = <span style="color: #800000">&quot;Cancel&quot;</span>

  <span style="color: #008000">' Test for an error.</span>
  <span style="color: #0000ff">If</span> Err.Number &lt;&gt; 0 <span style="color: #0000ff">Then</span>
      MsgBox <span style="color: #800000">&quot;Error: &quot;</span> &amp; Err.Number &amp; vbCrLf &amp; Err.Description
  <span style="color: #0000ff">Else</span>
    <span style="color: #008000">' Store the original dialog title.</span>
    strOldTitle = Document.title
    <span style="color: #008000">' Display a status message.</span>
    Document.title = strProcessing &amp; Time()
    <span style="color: #008000">' Pause briefly to let the screen refresh and capture events.</span>
    <span style="color: #0000ff">Call</span> DoEvents()
    <span style="color: #008000">' Create a text-to-speech object.</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms720149.aspx</span>
    <span style="color: #0000ff">Set</span> objSAPI = CreateObject(<span style="color: #800000">&quot;SAPI.SpVoice&quot;</span>)
    <span style="color: #008000">' Create a SAPI file stream object.</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms722561.aspx</span>
    <span style="color: #0000ff">Set</span> objFileStream = CreateObject(<span style="color: #800000">&quot;SAPI.SpFileStream&quot;</span>)
    <span style="color: #008000">' Specify the stream format.</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms720998.aspx</span>
    objFileStream.Format.Type = SAFT44kHz16BitStereo
    <span style="color: #008000">' Open the output file stream.</span>
    objFileStream.Open strOutputFilename, SSFMCreateForWrite
    <span style="color: #008000">' Specify the output file stream.</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms723597.aspx</span>
    <span style="color: #0000ff">Set</span> objSAPI.AudioOutputStream = objFileStream
    
    <span style="color: #008000">' Specify the speaking rate.</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms723606.aspx</span>
    objSAPI.Rate = optRate.Options(optRate.SelectedIndex).Value
    <span style="color: #008000">' Specify the speaking volume.</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms723615.aspx</span>
    objSAPI.Volume = optVolume.Options(optVolume.SelectedIndex).Value
    <span style="color: #008000">' Specify the voice to use.</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms723601.aspx</span>
    <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms723614.aspx</span>
    <span style="color: #0000ff">Set</span> objSAPI.Voice = objSAPI.GetVoices(<span style="color: #800000">&quot;&quot;</span>,<span style="color: #800000">&quot;&quot;</span>).Item(optVoices.SelectedIndex)
    
    <span style="color: #008000">' Loop through the lines in the input file.</span>
    <span style="color: #0000ff">Do</span> <span style="color: #0000ff">While</span> <span style="color: #0000ff">Not</span> objFile.AtEndOfStream
      <span style="color: #008000">' Test if we need to cancel bubbling of events.</span>
      <span style="color: #0000ff">If</span> blnCancelBubble = <span style="color: #0000ff">True</span> <span style="color: #0000ff">Then</span>
        <span style="color: #0000ff">Exit</span> <span style="color: #0000ff">Do</span>
      <span style="color: #0000ff">Else</span>
        <span style="color: #008000">' Display a status message.</span>
        Document.title = strProcessing &amp; Time()
        <span style="color: #008000">' Pause briefly to let the screen refresh and capture events.</span>
        <span style="color: #0000ff">Call</span> DoEvents()
        <span style="color: #008000">' Speak one line from the input file.</span>
        <span style="color: #008000">' See http://msdn.microsoft.com/en-us/library/ms723609.aspx</span>
        objSAPI.Speak objFile.ReadLine
      <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span>
    <span style="color: #0000ff">Loop</span>
    <span style="color: #008000">' Close the output file stream.</span>
    objFileStream.Close
  <span style="color: #0000ff">End</span> <span style="color: #0000ff">If</span>

  <span style="color: #008000">' Close the input file.</span>
  objFile.Close

  <span style="color: #008000">' Destroy all objects.</span>
  <span style="color: #0000ff">Set</span> objFileStream = <span style="color: #0000ff">Nothing</span>
  <span style="color: #0000ff">Set</span> objSAPI = <span style="color: #0000ff">Nothing</span>
  <span style="color: #0000ff">Set</span> objFile = <span style="color: #0000ff">Nothing</span>
  <span style="color: #0000ff">Set</span> objFSO = <span style="color: #0000ff">Nothing</span>
  
  <span style="color: #008000">' Reset the original dialog title.</span>
  Document.title = strOldTitle

  <span style="color: #008000">' Notify the user that the file has been written.</span>
  MsgBox <span style="color: #800000">&quot;Finished!&quot;</span>, vbInformation, strOldTitle
  
  <span style="color: #008000">' Re-enable the form fields.</span>
  btnClose.Value = <span style="color: #800000">&quot;Close&quot;</span>
  optVoices.Disabled = <span style="color: #0000ff">False</span>
  optRate.Disabled = <span style="color: #0000ff">False</span>
  optVolume.Disabled = <span style="color: #0000ff">False</span>
  txtFile.Disabled = <span style="color: #0000ff">False</span>
  btnWrite.Disabled = <span style="color: #0000ff">False</span>

<span style="color: #0000ff">End</span> <span style="color: #0000ff">Sub</span>

<span style="color: #0000ff">&lt;/</span><span style="color: #800000">script</span><span style="color: #0000ff">&gt;</span>

<span style="color: #0000ff">&lt;</span><span style="color: #800000">body</span> <span style="color: #ff0000">bgcolor</span><span style="color: #0000ff">=&quot;white&quot;</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;HtmlBody&quot;&gt;</span>
<span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;FormControls&quot;&gt;</span>
  <span style="color: #0000ff">&lt;</span><span style="color: #800000">table</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">tr</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;</span><span style="color: #800000">td</span> <span style="color: #ff0000">align</span><span style="color: #0000ff">=&quot;left&quot;&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">input</span> <span style="color: #ff0000">type</span><span style="color: #0000ff">=&quot;file&quot;</span>
        <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:250px;height:22px&quot;</span>
        <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;txtFile&quot;</span>
        <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;txtFile&quot;</span>
        <span style="color: #ff0000">onchange</span><span style="color: #0000ff">=&quot;txtFile_OnChange&quot;&gt;</span>
      <span style="color: #0000ff">&lt;/</span><span style="color: #800000">td</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;</span><span style="color: #800000">td</span> <span style="color: #ff0000">align</span><span style="color: #0000ff">=&quot;left&quot;&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">input</span> <span style="color: #ff0000">type</span><span style="color: #0000ff">=&quot;button&quot;</span>
        <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:125px;height:22px&quot;</span>
        <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;btnWrite&quot;</span>
        <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;btnWrite&quot;</span>
        <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;Write File&quot;</span>
        <span style="color: #ff0000">disabled</span>
        <span style="color: #ff0000">onclick</span><span style="color: #0000ff">=&quot;btnWrite_OnClick&quot;&gt;</span>
      <span style="color: #0000ff">&lt;/</span><span style="color: #800000">td</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;</span><span style="color: #800000">td</span> <span style="color: #ff0000">align</span><span style="color: #0000ff">=&quot;right&quot;&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">input</span> <span style="color: #ff0000">type</span><span style="color: #0000ff">=&quot;button&quot;</span>
        <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:125px;height:22px&quot;</span>
        <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;btnClose&quot;</span>
        <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;btnClose&quot;</span>
        <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;Close&quot;</span>
        <span style="color: #ff0000">onclick</span><span style="color: #0000ff">=&quot;btnClose_OnClick&quot;&gt;</span>
      <span style="color: #0000ff">&lt;/</span><span style="color: #800000">td</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">tr</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">tr</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;</span><span style="color: #800000">td</span> <span style="color: #ff0000">align</span><span style="color: #0000ff">=&quot;left&quot;&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">select</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;optVoices&quot;</span>
          <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:250px;height:22px&quot;&gt;</span>
        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">select</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;/</span><span style="color: #800000">td</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;</span><span style="color: #800000">td</span> <span style="color: #ff0000">align</span><span style="color: #0000ff">=&quot;left&quot;&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">select</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;optRate&quot;</span>
          <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:125px;height:22px&quot;&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;-2&quot;&gt;</span>Slowest<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;-1&quot;&gt;</span>Slower<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;0&quot;</span> <span style="color: #ff0000">selected</span><span style="color: #0000ff">&gt;</span>Normal Speed<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;1&quot;&gt;</span>Faster<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;2&quot;&gt;</span>Fastest<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">select</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;/</span><span style="color: #800000">td</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;</span><span style="color: #800000">td</span> <span style="color: #ff0000">align</span><span style="color: #0000ff">=&quot;right&quot;&gt;</span>
        <span style="color: #0000ff">&lt;</span><span style="color: #800000">select</span> <span style="color: #ff0000">name</span><span style="color: #0000ff">=&quot;optVolume&quot;</span>
          <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:125px;height:22px&quot;&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;25&quot;&gt;</span>25% Volume<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;50&quot;&gt;</span>50% Volume<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;75&quot;&gt;</span>75% Volume<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
          <span style="color: #0000ff">&lt;</span><span style="color: #800000">option</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">=&quot;100&quot;</span> <span style="color: #ff0000">selected</span><span style="color: #0000ff">&gt;</span>Full Volume<span style="color: #0000ff">&lt;/</span><span style="color: #800000">option</span><span style="color: #0000ff">&gt;</span>
        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">select</span><span style="color: #0000ff">&gt;</span>
      <span style="color: #0000ff">&lt;/</span><span style="color: #800000">td</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">tr</span><span style="color: #0000ff">&gt;</span>
  <span style="color: #0000ff">&lt;/</span><span style="color: #800000">table</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #800000">body</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #800000">html</span><span style="color: #0000ff">&gt;</span></pre>

<p>Note that I intentionally chose to have this HTML Application convert the text to audio one line at a time; this slows the down the conversion process, but it allows the conversion to be cancelled if necessary. (My original version of this script would convert an entire text file at one time; since there was no way to cancel the operation, the script appeared to hang when converting larger text files.)</p>

<h3>Additional Notes</h3>

<p>Once you have created a Wave (*.WAV) file, you can optionally convert it to an MP3 file for use in an MP3 player or mobile phone. (Most devices should playback Wave files, but MP3 files are considerably smaller and more portable.) There are a variety of Wave-to-MP3 converters out there, but I prefer to use the LAME encoder, which is an open-source code project <a href="http://lame.sourceforge.net/" target="_blank">that is available on SourceForge</a>. Once you have the LAME encoder project compiled, (or you have located and downloaded a pre-compiled version), you can use LAME.EXE from a command prompt to convert your Wave files into MP3 files.</p>

<p>That being said, I prefer to automate as much as possible, so I have written a batch file which converts all of the Wave files in a directory to MP3 files and renames the source Wave files with a &quot;*.old&quot; filename extension:</p>

<pre style="color: black; margin-left: 20px; background-color: #ffffff">@<span style="color: #0000ff">echo</span> <span style="color: #0000ff">off
</span>
<span style="color: #0000ff">for</span> /f <span style="color: #800000">&quot;usebackq delims=|&quot;</span> %%a <span style="color: #0000ff">in</span> (<span style="color: #800000">`dir /b *.wav`</span>) <span style="color: #0000ff">do</span> (
  <span style="color: #0000ff">for</span> %%b <span style="color: #0000ff">in</span> (^&quot;%%a^&quot;) do (
    <span style="color: #0000ff">if</span> <span style="color: #0000ff">not</span> <span style="color: #0000ff">exist</span> <span style="color: #800000">&quot;%%~db%%~pb%%~nb.mp3&quot;</span> (
      lame.exe -b 128 -m j <span style="color: #800000">&quot;%%a&quot;</span> <span style="color: #800000">&quot;%%~nb.mp3&quot;</span>
    )
    <span style="color: #0000ff">if</span> <span style="color: #0000ff">exist</span> <span style="color: #800000">&quot;%%~db%%~pb%%~nb.mp3&quot;</span> (
      <span style="color: #0000ff">move</span> <span style="color: #800000">&quot;%%a&quot; &quot;%%a.old&quot;</span>
    )
  )
)</pre>

<p>Note that the above batch file was written for text-to-speech use, and as such it defines a bit rate of 128kbps, which would be pretty low for music files. If you want to repurpose this batch file for higher bitrates, modify the value of the &quot;-b&quot; parameter for the LAME.EXE command.</p>

<p>That wraps it up for today's post.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to create an HTML Application to configure your IIS SMTP Username and Password settings</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/how-to-create-an-html-application-to-configure-your-iis-smtp-username-and-password-settings</link>
      <pubDate>Fri, 22 May 2015 16:11:00 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2015/05/22/how-to-create-an-html-application-to-configure-your-iis-smtp-username-and-password-settings/</guid>
      <description><![CDATA[Like many IIS administrators, I usually install the local SMTP service on my IIS servers when I am...]]></description>
      <content:encoded><![CDATA[<p>Like many IIS administrators, I usually install the local SMTP service on my IIS servers when I am setting up a new server from scratch. When I install the SMTP service, I configure it so that it only listens on the IP address of 127.0.0.1, so it can only send emails which originate on the server itself. What's more, I configure the SMTP service to relay all emails to a downstream SMTP service which can send emails out to the Internet. By configuring these options, I can write my ASP.NET, PHP, and Classic ASP applications so that they use the local SMTP service for all email-related functionality, which acts as a sort of message server for my applications. This system works great, and I have used this particular setup since the days of IIS 4.0. (Which was released in late 1997, as you may recall.)</p>
<p>That being said, in the interests of security, sometime ago I started using a downstream SMTP service which requires user credentials, (that way no one could use the downstream server anonymously). As an additional security step, I use an account which requires that the credentials are changed every 30 days or so. This is always a good security practice for a myriad of obvious reasons, but this meant that I needed to update the SMTP username/password settings in my IIS configuration settings every 30 days.</p>
<p>With that in mind, many years ago I wrote a simple VBScript application which I would use to update those credentials. At first I would simply enter the credentials directly into the script, then I would run it to update IIS, and then I would strip the credentials from the script. Needless to say, this was pretty low-tech - even considering that this was 17 or 18 years ago. I eventually updated the script so that it would use VBScript Input Boxes to prompt me for the credentials, so I no longer needed to store the credentials in the script itself. (Sometime after that I rewrote the script so that it would read the existing values from the IIS settings and pre-populate the input boxes.)</p>
<p>Jumping ahead a couple of years, I decided to rewrite the script as an HTML Application, which offered me considerably more options from a user interface perspective. That script has been serving me faithfully for some time now, so I thought that it would make a good blog subject.</p>
<h3>Using the HTML Application</h3>
<p>Using the application is pretty straight-forward; when you double click the HTA file, it will present you with the following user interface:</p>
<p style="margin-left: 20px;"><img src="https://1kztfw.dm2303.livefilestore.com/y2p9MsefZywsqmunHHe-sY2TwFp5Q7cVnbTLY-B9COb7luzRnjIh2aVEJODyhH1Ae03hHy7x4IbfqOxOuctq0kLbLW7jOYzPhlqfeHq6yDJdMECn0M-_lWrdwq3AVLpH8GQsp1qy6Y82RxCvaD44wWG3hSprXfT388Vv50Bb-goB10/SMTP_HTMLA_UI_1.png" alt="" width="280" height="220" /></p>
<p>The script will read any existing credentials from your IIS settings and use those to pre-populate the interface. If no existing credentials are found, it will pre-populate the interface with the username of the currently-logged-on user.</p>
<p>Clicking <strong>Update</strong> will update your IIS settings, clicking <strong>Reset</strong> will reset the values back to the last saved version, and clicking <strong>Close</strong> will obviously close the application, but only after it has checked if you have any unsaved changes.</p>
<h3>Creating the HTML Application</h3>
<p>To create this HTML Application, save the following HTMLA code as "<strong><em>Reset SMTP Password.hta</em></strong>" to your computer, and then double-click its icon to run the application.</p>
<pre style="color: #000; margin-left: 20px; background-color: #fff;"><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">html</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;</span><span style="color: #800000;">head</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span>Reset SMTP Password<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;</span><span style="color: #800000;">HTA:APPLICATION</span>
  <span style="color: #ff0000;">APPLICATIONNAME</span><span style="color: #0000ff;">="Reset SMTP Password"</span>
  <span style="color: #ff0000;">ID</span><span style="color: #0000ff;">="ResetSmtpPassword"</span>
  <span style="color: #ff0000;">VERSION</span><span style="color: #0000ff;">="1.0"</span>
  <span style="color: #ff0000;">BORDER</span><span style="color: #0000ff;">="dialog"</span>
  <span style="color: #ff0000;">BORDERSTYLE</span><span style="color: #0000ff;">="static"</span>
  <span style="color: #ff0000;">INNERBORDER</span><span style="color: #0000ff;">="no"</span>
  <span style="color: #ff0000;">CAPTION</span><span style="color: #0000ff;">="yes"</span>
  <span style="color: #ff0000;">SYSMENU</span><span style="color: #0000ff;">="no"</span>
  <span style="color: #ff0000;">MAXIMIZEBUTTON</span><span style="color: #0000ff;">="no"</span>
  <span style="color: #ff0000;">MINIMIZEBUTTON</span><span style="color: #0000ff;">="no"</span>
  <span style="color: #ff0000;">SCROLL</span><span style="color: #0000ff;">="no"</span>
  <span style="color: #ff0000;">SCROLLFLAT</span><span style="color: #0000ff;">="yes"</span>
  <span style="color: #ff0000;">SINGLEINSTANCE</span><span style="color: #0000ff;">="yes"</span>
  <span style="color: #ff0000;">CONTEXTMENU</span><span style="color: #0000ff;">="no"</span>
  <span style="color: #ff0000;">SELECTION</span><span style="color: #0000ff;">="no"</span><span style="color: #0000ff;">/&gt;</span>
<span style="color: #0000ff;">&lt;</span><span style="color: #800000;">style</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #008000;">&lt;!--</span>
<span style="color: #008000;">body,input<br />{<br /> font-family:calibri,arial;<br /> font-size:9pt;<br /> color: #000;<br /> background-color: #fff;<br />}</span>
<span style="color: #008000;">table,td,th<br />{<br /> border:none;<br />}</span>
<span style="color: #008000;">--&gt;</span>
<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">style</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">head</span><span style="color: #0000ff;">&gt;</span>

<span style="color: #0000ff;">&lt;</span><span style="color: #800000;">script</span> <span style="color: #ff0000;">language</span><span style="color: #0000ff;">="VBScript"<span style="color: #0000ff;">&gt;</span></span>
<span style="color: #0000ff;">Option</span> Explicit

<span style="color: #008000;">' Define the global variables.</span>
<span style="color: #0000ff;">Dim</span> objWMIService, objIIsSmtpServer
<span style="color: #0000ff;">Dim</span> strRouteUserName, strRoutePassword
<span style="color: #0000ff;">Dim</span> blnCancelBubble, blnPendingUpdates

<span style="color: #008000;">' ----------------------------------------</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' Initialization method for the application.</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' ----------------------------------------</span>

<span style="color: #0000ff;">Sub</span> Window_OnLoad

    <span style="color: #008000;">' Define the local variables.</span>
    <span style="color: #0000ff;">Dim</span> objNetwork

    <span style="color: #008000;">' Set up the UI dimensions.</span>
    <span style="color: #0000ff;">Const</span> intDialogWidth = 280
    <span style="color: #0000ff;">Const</span> intDialogHeight = 220
    <span style="color: #008000;">' Specify the window position and size.</span>
    Self.resizeTo intDialogWidth,intDialogHeight
    Self.moveTo (Screen.AvailWidth - intDialogWidth) / 2, _
        (Screen.AvailHeight - intDialogHeight) / 2
        
    <span style="color: #008000;">' Enable events.</span>
    blnCancelBubble = <span style="color: #0000ff;">False</span>
    blnPendingUpdates = <span style="color: #0000ff;">False</span>

    <span style="color: #008000;">' Set up some base objects for the local computer and default SMTP instance.</span>
    <span style="color: #008000;">' Note that these settings can be customized for a different computer or SMTP instance.</span>
    <span style="color: #0000ff;">Set</span> objWMIService = GetObject(<span style="color: #800000;">"winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2"</span>)
    <span style="color: #0000ff;">Set</span> objIIsSmtpServer = GetObject(<span style="color: #800000;">"IIS://localhost/SmtpSvc/1"</span>)
    
    <span style="color: #008000;">' Retrieve the current username/password from the SMTP settings.</span>
    strRouteUserName = objIIsSmtpServer.RouteUserName
    strRoutePassword = objIIsSmtpServer.RoutePassword
    
    <span style="color: #008000;">' Verify that a username was retrieved; otherwise, use the logged-on user.</span>
    <span style="color: #0000ff;">If</span> Len(strRouteUserName)=0 <span style="color: #0000ff;">Then</span>
        <span style="color: #0000ff;">Set</span> objNetwork = CreateObject(<span style="color: #800000;">"WScript.Network"</span>)
        strRouteUserName = IIf(Len(objNetwork.UserDomain)&gt;0, _
            objNetwork.UserDomain &amp; <span style="color: #800000;">"\"</span>,<span style="color: #800000;">""</span>) &amp; objNetwork.UserName
        <span style="color: #0000ff;">Set</span> objNetwork = <span style="color: #0000ff;">Nothing</span>
        blnPendingUpdates = <span style="color: #0000ff;">True</span>
    <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>
    
    <span style="color: #008000;">' Store the username/password values in the UI.</span>
    txtUsername.value = strRouteUserName
    txtPassword.value = strRoutePassword
    
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span>

<span style="color: #008000;">' ----------------------------------------</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' Implement the missing IIf() function.</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' ----------------------------------------</span>

<span style="color: #0000ff;">Function</span> IIf(tx,ty,tz)
    <span style="color: #0000ff;">If</span> (tx) <span style="color: #0000ff;">Then</span> IIf = ty <span style="color: #0000ff;">Else</span> IIf = tz
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Function</span>

<span style="color: #008000;">' ----------------------------------------</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' Click handler for the Close button.</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' ----------------------------------------</span>

<span style="color: #0000ff;">Sub</span> btnClose_OnClick()
    <span style="color: #008000;">' Test if we need to cancel bubbling of events.</span>
    <span style="color: #0000ff;">If</span> blnCancelBubble = <span style="color: #0000ff;">False</span> <span style="color: #0000ff;">Then</span>
        <span style="color: #008000;">' Check if there are pending updates.</span>
        <span style="color: #0000ff;">If</span> blnPendingUpdates = <span style="color: #0000ff;">False</span> <span style="color: #0000ff;">Then</span>
            <span style="color: #008000;">' If not, then close the application.</span>
            Window.close
        <span style="color: #008000;">' Prompt the user to exit.</span>
        <span style="color: #0000ff;">ElseIf</span> MsgBox(<span style="color: #800000;">"You have not saved your changes."</span> &amp; vbCrLf &amp; _
                <span style="color: #800000;">"Are you sure you wish to exit?"</span>, _
                vbYesNo+vbDefaultButton2+vbQuestion+vbSystemModal, _
                ResetSmtpPassword.applicationName)=vbYes <span style="color: #0000ff;">Then</span>
                <span style="color: #008000;">' Enable event bubbling.</span>
                blnCancelBubble = <span style="color: #0000ff;">True</span>
                <span style="color: #008000;">' Close the application.</span>
                Window.close
        <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>
    <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>
    <span style="color: #008000;">' Specify whether to bubble events.</span>
       blnCancelBubble = IIf(blnCancelBubble=<span style="color: #0000ff;">True</span>,<span style="color: #0000ff;">False</span>,<span style="color: #0000ff;">True</span>)
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span>

<span style="color: #008000;">' ----------------------------------------</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' Change handler for text boxes.</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' ----------------------------------------</span>

<span style="color: #0000ff;">Sub</span> Textbox_OnChange()
    <span style="color: #008000;">' Flag the application as having updates pending.</span>
    blnPendingUpdates = <span style="color: #0000ff;">True</span>
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span>

<span style="color: #008000;">' ----------------------------------------</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' Focus handler for text boxes.</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' ----------------------------------------</span>

<span style="color: #0000ff;">Sub</span> Textbox_OnFocus(objTextbox)
    <span style="color: #008000;">' Select the text in the textbox.</span>
    objTextbox.<span style="color: #0000ff;">Select</span>
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span>

<span style="color: #008000;">' ----------------------------------------</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' Click handler for the Reset button.</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' ----------------------------------------</span>

<span style="color: #0000ff;">Sub</span> btnReset_OnClick()
    <span style="color: #008000;">' Reset the username/password values in the UI.</span>
    txtUsername.value = strRouteUserName
    txtPassword.value = strRoutePassword
    blnPendingUpdates = <span style="color: #0000ff;">False</span>
<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span>

<span style="color: #008000;">' ----------------------------------------</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' Click handler for the Update button.</span>
<span style="color: #008000;">' </span>
<span style="color: #008000;">' ----------------------------------------</span>

<span style="color: #0000ff;">Sub</span> btnUpdate_OnClick()

    <span style="color: #008000;">' Catch bubbled events.</span>
    <span style="color: #0000ff;">If</span> blnCancelBubble = <span style="color: #0000ff;">True</span> <span style="color: #0000ff;">Then</span>
        blnCancelBubble = <span style="color: #0000ff;">False</span>
        <span style="color: #0000ff;">Exit</span> <span style="color: #0000ff;">Sub</span>
    <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>

    <span style="color: #008000;">' Verify valid data.</span>
    <span style="color: #0000ff;">If</span> Len(txtUsername.value)=0 <span style="color: #0000ff;">Or</span> Len(txtPassword.value)=0 <span style="color: #0000ff;">Then</span>
        <span style="color: #008000;">' Inform the user that they made a mistake.</span>
        MsgBox <span style="color: #800000;">"An invalid username or password was entered."</span>, _
            vbCritical + vbOKOnly, ResetSmtpPassword.applicationName
        <span style="color: #008000;">' Cancel event bubbling.</span>
        blnCancelBubble = <span style="color: #0000ff;">True</span>
    <span style="color: #0000ff;">Else</span>
        <span style="color: #008000;">' Store the username/password values for the SMTP server.</span>
        objIIsSmtpServer.RouteUserName = txtUsername.value
        objIIsSmtpServer.RoutePassword = txtPassword.value
        objIIsSmtpServer.SetInfo

        <span style="color: #008000;">' Save the username/password values.</span>
        strRouteUserName = txtUsername.value
        strRoutePassword = txtPassword.value

        <span style="color: #008000;">' Flag the application as having no updates pending.</span>
        blnPendingUpdates = <span style="color: #0000ff;">False</span>

        <span style="color: #008000;">' Cancel event bubbling.</span>
        blnCancelBubble = <span style="color: #0000ff;">True</span>
    <span style="color: #0000ff;">End</span> <span style="color: #0000ff;">If</span>

<span style="color: #0000ff;">End</span> <span style="color: #0000ff;">Sub</span>
<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">script</span><span style="color: #0000ff;">&gt;</span>

<span style="color: #0000ff;">&lt;</span><span style="color: #800000;">body</span> <span style="color: #ff0000;">bgcolor</span><span style="color: #0000ff;">="white"</span> <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="HtmlBody"</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;</span><span style="color: #800000;">div</span> <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="FormControls"</span><span style="color: #0000ff;">&gt;</span>
    <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">table</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;&lt;</span><span style="color: #800000;">td</span><span style="color: #0000ff;">&gt;</span>Please enter your SMTP credentials:<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">td</span><span style="color: #0000ff;">&gt;&lt;/</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">td</span> <span style="color: #ff0000;">align</span><span style="color: #0000ff;">="left"</span><span style="color: #0000ff;">&gt;</span>
                <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">input</span> <span style="color: #ff0000;">type</span><span style="color: #0000ff;">="text"</span>
                <span style="color: #ff0000;">style</span><span style="color: #0000ff;">="width:250px;height:22px"</span>
                <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="txtUsername"</span>
                <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="txtUsername"</span>
                <span style="color: #ff0000;">onchange</span><span style="color: #0000ff;">="Textbox_OnChange()"</span>
                <span style="color: #ff0000;">onfocus</span><span style="color: #0000ff;">="Textbox_OnFocus(txtUsername)"</span> <span style="color: #0000ff;">/&gt;</span>
            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">td</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">td</span> <span style="color: #ff0000;">align</span><span style="color: #0000ff;">="left"</span><span style="color: #0000ff;">&gt;</span>
                <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">input</span> <span style="color: #ff0000;">type</span><span style="color: #0000ff;">="password"</span>
                <span style="color: #ff0000;">style</span><span style="color: #0000ff;">="width:250px;height:22px"</span>
                <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="txtPassword"</span>
                <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="txtPassword"</span>
                <span style="color: #ff0000;">onchange</span><span style="color: #0000ff;">="Textbox_OnChange()"</span>
                <span style="color: #ff0000;">onfocus</span><span style="color: #0000ff;">="Textbox_OnFocus(txtPassword)"</span> <span style="color: #0000ff;">/&gt;</span>
            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">td</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">td</span> <span style="color: #ff0000;">align</span><span style="color: #0000ff;">="right"</span><span style="color: #0000ff;">&gt;</span>
                <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">input</span> <span style="color: #ff0000;">type</span><span style="color: #0000ff;">="button"</span>
                <span style="color: #ff0000;">style</span><span style="color: #0000ff;">="width:125px;height:22px"</span>
                <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="btnUpdate"</span>
                <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="btnUpdate"</span>
                <span style="color: #ff0000;">value</span><span style="color: #0000ff;">="Update"</span>
                <span style="color: #ff0000;">onclick</span><span style="color: #0000ff;">="btnUpdate_OnClick()"</span> <span style="color: #0000ff;">/&gt;</span>
            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">td</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">td</span> <span style="color: #ff0000;">align</span><span style="color: #0000ff;">="right"</span><span style="color: #0000ff;">&gt;</span>
                <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">input</span> <span style="color: #ff0000;">type</span><span style="color: #0000ff;">="button"</span>
                <span style="color: #ff0000;">style</span><span style="color: #0000ff;">="width:125px;height:22px"</span>
                <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="btnReset"</span>
                <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="btnReset"</span>
                <span style="color: #ff0000;">value</span><span style="color: #0000ff;">="Reset"</span>
                <span style="color: #ff0000;">onclick</span><span style="color: #0000ff;">="btnReset_OnClick()"</span> <span style="color: #0000ff;">/&gt;</span>
            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">td</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
            <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">td</span> <span style="color: #ff0000;">align</span><span style="color: #0000ff;">="right"</span><span style="color: #0000ff;">&gt;</span>
                <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">input</span> <span style="color: #ff0000;">type</span><span style="color: #0000ff;">="button"</span>
                <span style="color: #ff0000;">style</span><span style="color: #0000ff;">="width:125px;height:22px"</span>
                <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="btnClose"</span>
                <span style="color: #ff0000;">id</span><span style="color: #0000ff;">="btnClose"</span>
                <span style="color: #ff0000;">value</span><span style="color: #0000ff;">="Close"</span>
                <span style="color: #ff0000;">onclick</span><span style="color: #0000ff;">="btnClose_OnClick()"</span> <span style="color: #0000ff;">/&gt;</span>
            <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">td</span><span style="color: #0000ff;">&gt;</span>
        <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">&gt;</span>
    <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">table</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">div</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">body</span><span style="color: #0000ff;">&gt;</span>
<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">html</span><span style="color: #0000ff;">&gt;</span></pre>
<p>That's all that there is to it, although you might want to restart your SMTP service after you have made these changes.</p>
<h3>Additional Notes</h3>
<p>On a related topic, I get asked from time to time why I like to use HTML Applications (HTMLA) for some of my scripting examples, and the answer is quite simple: it is very easy to create powerful scripts in a very short amount of time which have sophisticated user interfaces and no compilation requirements.</p>
<p>I use <a href="http://htaedit.com/" target="_blank">Adersoft's HtaEdit</a> as my IDE for HTMLA, which allows me to do normal development tasks like configuring project options, setting breakpoints, and stepping through my code.</p>
<p style="margin-left: 20px;"><a href="https://1kztfw.dm2303.livefilestore.com/y2pVMfKuZ6r7YTXIwTdiFCyaJJePhWo0SKEViFiZxS-IyVVocup_sHxfflJwGtson46gEz5P31SHtCWFIdSH_YVQ9oIcmEmFg10HsFS9ea3FnEKcxIMPnd3C43VP_lI6MXwyduen2C-AgTtqQcpyZ-lcwfMODWraworMUJzmaP9GJc/SMTP_HTMLA_UI_2.png" target="_blank"><img src="https://1kztfw.dm2303.livefilestore.com/y2pVMfKuZ6r7YTXIwTdiFCyaJJePhWo0SKEViFiZxS-IyVVocup_sHxfflJwGtson46gEz5P31SHtCWFIdSH_YVQ9oIcmEmFg10HsFS9ea3FnEKcxIMPnd3C43VP_lI6MXwyduen2C-AgTtqQcpyZ-lcwfMODWraworMUJzmaP9GJc/SMTP_HTMLA_UI_2.png" alt="" width="450" height="351" /></a> <br /><em>Note: Click the image above to open it full-size in a separate window.</em></p>
<p>That being said, I have been experimenting with creating user interfaces in PowerShell, and it looks like it has some real promise for creating great UIs, too. But for now I only use PowerShell to create command line scripts, I use HTMLA to create cool UIs for administrative scripts, and I use C# to create "real" applications.</p>]]></content:encoded>
    </item>
    <item>
      <title>Command-Line Utility to Create BlogEngine.NET Password Hashes</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/command-line-utility-to-create-blogengine-net-password-hashes</link>
      <pubDate>Sat, 31 Jan 2015 01:36:35 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2015/01/31/command-line-utility-to-create-blogengine-net-password-hashes/</guid>
      <description><![CDATA[I ran into an interesting predicament the other day, and I thought that both the situation and my...]]></description>
      <content:encoded><![CDATA[<p>I ran into an interesting predicament the other day, and I thought that both the situation and my solution were worth sharing. Here's the scenario: I host websites for several family members and friends, and one of my family member's uses <a href="http://blogengine.codeplex.com/" target="_blank">BlogEngine.NET</a> for her blog. (As you may have seen in my previous blogs, I'm a big fan of BlogEngine.NET.) In any event, she forgot her password, so I logged into the admin section of her website, only to discover that there was no way for me to reset <em>her </em>password – I could only reset <em>my</em> password. Since it's my webserver, I have access to the physical files, so I decided to write a simple utility that can create the requisite SHA256/BASE64 password hashes that BlogEngine.NET uses, and then I can manually update the <em>Users.xml</em> file with new password hashes as I create them.</p>  <p>With that in mind, here is the code for the command-line utility:</p>  <pre style="color: #000; margin-left: 20px; background-color: #fff"><span style="color: #0000ff">using</span> System;
<span style="color: #0000ff">using</span> System.Collections.Generic;
<span style="color: #0000ff">using</span> System.Linq;
<span style="color: #0000ff">using</span> System.Security.Cryptography;
<span style="color: #0000ff">using</span> System.Text;
<span style="color: #0000ff">using</span> System.Threading.Tasks;

<span style="color: #0000ff">namespace</span> BlogEnginePasswordHash
{
  <span style="color: #0000ff">class</span> Program
  {
    <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> Main(<span style="color: #0000ff">string</span>[] args)
    {
      <span style="color: #008000">// Verify that a single argument was passed to the application...</span>
      <span style="color: #0000ff">if</span> (args.Length != 1)
      {
        <span style="color: #008000">// ...if not, reply with generic help message.</span>
        Console.WriteLine(<span style="color: #800000">&quot;\nUSAGE: BlogEnginePasswordHash &lt;password&gt;\n&quot;</span>);
      }
      <span style="color: #008000">// ...otherwise...</span>
      <span style="color: #0000ff">else</span>
      {
        <span style="color: #008000">// Retrieve a sequence of bytes for the password argument.</span>
        var passwordBytes = Encoding.UTF8.GetBytes(args[0]);
        <span style="color: #008000">// Retrieve a SHA256 object.</span>
        <span style="color: #0000ff">using</span> (HashAlgorithm sha256 = <span style="color: #0000ff">new</span> SHA256Managed())
        {
          <span style="color: #008000">// Hash the password.</span>
          sha256.TransformFinalBlock(passwordBytes, 0, passwordBytes.Length);
          <span style="color: #008000">// Convert the hashed password to a Base64 string.</span>
          <span style="color: #0000ff">string</span> passwordHash = Convert.ToBase64String(sha256.Hash);
          <span style="color: #008000">// Display the password and it's hash.</span>
          Console.WriteLine(<span style="color: #800000">&quot;\nPassword: {0}\nHash: {1}\n&quot;</span>, args[0], passwordHash);
        }
      }
    }
  }
}</pre>

<p>That code snippet should be pretty self-explanatory; the application takes a single argument, which is the password to hash. Once you enter a password and hit enter, the password and it's respective hash will be displayed.</p>

<p>Here are a few examples:</p>

<pre style="color: #fff; padding-bottom: 5px; padding-top: 5px; padding-left: 5px; margin-left: 20px; padding-right: 5px; background-color: #000"><strong>C:\&gt;BlogEnginePasswordHash.exe &quot;This is my password&quot;

Password: This is my password
Hash: 6tV+IGzvN4gaQ0vmCWNHSQ0UQ0WgW4+ThJuhpXR6Z3c=

C:\&gt;BlogEnginePasswordHash.exe Password1

Password: Password1
Hash: GVE/3J2k+3KkoF62aRdUjTyQ/5TVQZ4fI2PuqJ3+4d0=

C:\&gt;BlogEnginePasswordHash.exe Password2

Password: Password2
Hash: G+AiJ1Cq84iauVtdWTuhLk/xBGR0cC1rR3n0tScwWyM=

C:\&gt;</strong></pre>

<p>Once you have created password hashes, you can paste those into the <i>Users.xml</i> file for your website:</p>

<pre style="color: #000; margin-left: 20px; background-color: #fff"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Users</span><span style="color: #0000ff">&gt;</span>
  <span style="color: #0000ff">&lt;</span><span style="color: #800000">User</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">UserName</span><span style="color: #0000ff">&gt;</span>Alice<span style="color: #0000ff">&lt;/</span><span style="color: #800000">UserName</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Password</span><span style="color: #0000ff">&gt;</span>GVE/3J2k+3KkoF62aRdUjTyQ/5TVQZ4fI2PuqJ3+4d0=<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Password</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Email</span><span style="color: #0000ff">&gt;</span>alice@fabrikam.com<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Email</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">LastLoginTime</span><span style="color: #0000ff">&gt;</span>2015-01-31 01:52:00<span style="color: #0000ff">&lt;/</span><span style="color: #800000">LastLoginTime</span><span style="color: #0000ff">&gt;</span>
  <span style="color: #0000ff">&lt;/</span><span style="color: #800000">User</span><span style="color: #0000ff">&gt;</span>
  <span style="color: #0000ff">&lt;</span><span style="color: #800000">User</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">UserName</span><span style="color: #0000ff">&gt;</span>Bob<span style="color: #0000ff">&lt;/</span><span style="color: #800000">UserName</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Password</span><span style="color: #0000ff">&gt;</span>G+AiJ1Cq84iauVtdWTuhLk/xBGR0cC1rR3n0tScwWyM=<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Password</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Email</span><span style="color: #0000ff">&gt;</span>bob@fabrikam.com<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Email</span><span style="color: #0000ff">&gt;</span>
    <span style="color: #0000ff">&lt;</span><span style="color: #800000">LastLoginTime</span><span style="color: #0000ff">&gt;</span>2015-01-31 01:53:00<span style="color: #0000ff">&lt;/</span><span style="color: #800000">LastLoginTime</span><span style="color: #0000ff">&gt;</span>
  <span style="color: #0000ff">&lt;/</span><span style="color: #800000">User</span><span style="color: #0000ff">&gt;</span>
<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Users</span><span style="color: #0000ff">&gt;</span></pre>

<p>That's all there is to do. Pretty simple stuff.</p>]]></content:encoded>
    </item>
    <item>
      <title>FTP Clients - Part 16: NetDrive</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/ftp-clients-part-16-netdrive</link>
      <pubDate>Sun, 30 Nov 2014 01:42:00 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2014/11/30/ftp-clients-part-16-netdrive/</guid>
      <description><![CDATA[For the next installments in my series about FTP clients, I will be taking a look at two FTP...]]></description>
      <content:encoded><![CDATA[<p>For the next installments in my series about FTP clients, I will be taking a look at two FTP redirectors at the same time. In this specific blog post, I will focus on NetDrive (from Bdrive Inc.), whereas my previous post looked at WebDrive (from South River Technologies).</p>
<p>At the time of this blog's writing, NetDrive is a for-retail FTP client and redirector which is available from the following URL:</p>
<p style="margin-left: 20px;"><a href="http://www.netdrive.net/" target="_blank">http://www.netdrive.net/</a></p>
<p>For this blog post I will be using NetDrive version 2.3.2.</p>
<h3>NetDrive 2.3 Overview</h3>
<p>NetDrive is different from many of the other FTP clients that I have reviewed because it is an Internet protocol redirector, meaning that it allows you to map drive letters to a variety of Internet repositories. When you install and open NetDrive, you are presented with the list of supported Internet protocols and repositories which you can use for mapping drives:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pRQYeiL5k4MpZTgc0Ktei8J2HPcv8Sa9RXU9qVc3xbn2XCtwyRuXOpU1m1MAQZDgCUkwaHXHatxmHBuHsU4KRL8pwAR9HGt0KxNkzf1yGbzE/NetDrive01.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pRQYeiL5k4MpZTgc0Ktei8J2HPcv8Sa9RXU9qVc3xbn2XCtwyRuXOpU1m1MAQZDgCUkwaHXHatxmHBuHsU4KRL8pwAR9HGt0KxNkzf1yGbzE/NetDrive01.png" alt="" width="450" height="315" /></a></p>
<p>As you can see from the illustration above, NetDrive's list of support technologies is quite extensive: DropBox, Box.net, Google Drive, OneDrive, Amazon S3, Openstack Swift, FTP, SFTP, and WebDAV.</p>
<p>When you add a drive or configure the settings for one of the default drives, you are presented with a dialog box where you can enter the settings for the drive connection; note that there are very few settings for FTP connections:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pogfVanDUzp1CiddFi8dm61mpx1SFDsQs9BWNhlHZoidDXsr9qD3hK0e5YJnTx-tkoxxJU-Bz7e35kh9W_4_n7yvlp0i8gNKluq5lbFmMcWw/NetDrive02.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pogfVanDUzp1CiddFi8dm61mpx1SFDsQs9BWNhlHZoidDXsr9qD3hK0e5YJnTx-tkoxxJU-Bz7e35kh9W_4_n7yvlp0i8gNKluq5lbFmMcWw/NetDrive02.png" alt="" width="450" height="265" /></a></p>
<p>As you add drives, the NetDrive user interface will display the drives and their current connection status:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pDdJDP_Q5QnAo_X5PQ1MLtXQhpQigq-keG81mPKs5ghFWKpY9LXUJa-RoocRBY82ZorqxG0OECfuEOEYxUy2ylpV94uomV8F0wvrd3FQAgws/NetDrive03.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pDdJDP_Q5QnAo_X5PQ1MLtXQhpQigq-keG81mPKs5ghFWKpY9LXUJa-RoocRBY82ZorqxG0OECfuEOEYxUy2ylpV94uomV8F0wvrd3FQAgws/NetDrive03.png" alt="" width="450" height="315" /></a></p>
<p>As an added touch, NetDrive customizes its drive icons in Windows Explorer, so you can easily see the type of mapped drive for each connection:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pXeMkPCewWubkQmWsIwv9kbveZELkdchUHcR1U5WmEkNUmXSlGbOdaVIp75BtB_YOBqPW9M2UebJkSMhe2KguMi89dPxxRbaTslzkvA6jN2Y/NetDrive04.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pXeMkPCewWubkQmWsIwv9kbveZELkdchUHcR1U5WmEkNUmXSlGbOdaVIp75BtB_YOBqPW9M2UebJkSMhe2KguMi89dPxxRbaTslzkvA6jN2Y/NetDrive04.png" alt="" width="450" height="315" /></a></p>
<p>I would love to take an in-depth look at all of the supported protocols in this review, but this series is about FTP clients, so I'll move on to the FTP-specific features that I normally review.</p>
<h3>Using NetDrive 2.3 with FTP over SSL (FTPS)</h3>
<p>NetDrive 2.3 has built-in support for FTP over SSL (FTPS), although it only appears to support <em><a href="http://blogs.msdn.com/b/robert_mcmurray/archive/2008/11/10/ftp-clients-part-2-explicit-ftps-versus-implicit-ftps.aspx" target="_blank">Explicit FTPS</a></em> - and it does so in a confusing way. When you are editing the settings for an FTP drive connection, you need to check the box for <strong>SSL/TLS</strong> in order to enable FTPS. Unfortunately, when you do so, the dialog box will change the port to 990, which is the port number for <em><a href="http://blogs.msdn.com/b/robert_mcmurray/archive/2008/11/10/ftp-clients-part-2-explicit-ftps-versus-implicit-ftps.aspx" target="_blank">Implicit FTPS</a></em>; however, in my testing I could not get Implicit FTPS to work:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2p4SBlVriu73A8VA9gJs-PSi8eM9HDjRlTHHFAwa7Ri52yq02W9W2AWHzoKEeS1SDdo9zFkSqx2iEZSHa0e1Jeyr1DC0_dy3KRuxQKgNmrBFA/NetDrive05.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2p4SBlVriu73A8VA9gJs-PSi8eM9HDjRlTHHFAwa7Ri52yq02W9W2AWHzoKEeS1SDdo9zFkSqx2iEZSHa0e1Jeyr1DC0_dy3KRuxQKgNmrBFA/NetDrive05.png" alt="" width="450" height="265" /></a></p>
<p>With the above information in mind, I needed to manually change the port number back to 21 in order to use Explicit FTPS with NetDrive:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pXoCyfWApCiynto6KwqrYzBrosHVoaREFrQwjvIbZk6Ja5gzRHK84FjtuBcxxKAhjkvTINW1ynocDUuaj9BVTeN0D25IT6xJzz5WadQyQPzo/NetDrive06.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pXoCyfWApCiynto6KwqrYzBrosHVoaREFrQwjvIbZk6Ja5gzRHK84FjtuBcxxKAhjkvTINW1ynocDUuaj9BVTeN0D25IT6xJzz5WadQyQPzo/NetDrive06.png" alt="" width="450" height="265" /></a></p>
<h3>Using NetDrive 2.3 with True FTP Hosts</h3>
<p>True FTP hosts are not supported natively by NetDrive 2.3, and there are no settings which allow you to customize the login environment in order to work around this situation.</p>
<h3>Using NetDrive 2.3 with Virtual FTP Hosts</h3>
<p>NetDrive 2.3's login settings allow you to specify the virtual host name as part of the user credentials by using syntax like "ftp.example.com|username" or "ftp.example.com\username", so you can use virtual FTP hosts with NetDrive 2.3.</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pl2pshbSVz9IHSZSVEKXRzytIYhUFEBOnn8AbyPHVv1hEaapTnnMuD_VDEHMQwr5wSiHNea5P14H59ewaNPR_nmfvcJUcgoHcITGl6_EleN0/NetDrive07.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pl2pshbSVz9IHSZSVEKXRzytIYhUFEBOnn8AbyPHVv1hEaapTnnMuD_VDEHMQwr5wSiHNea5P14H59ewaNPR_nmfvcJUcgoHcITGl6_EleN0/NetDrive07.png" alt="" width="450" height="265" /></a></p>
<h3>Scorecard for NetDrive 2.3</h3>
<p>This concludes my quick look at a few of the FTP features that are available with <em style="font-style: italic;">NetDrive 2.3</em>, and here are the scorecard results:</p>
<table style="background: #ffffff; border: 2px solid #000000; width: 450px; color: #000000; margin-left: 20px; border-collapse: collapse; border-image: none;">
<tbody>
<tr><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Client<br /> Name</th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Directory<br /> Browsing</th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89117" target="_blank">Explicit<br /> FTPS</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89117" target="_blank">Implicit<br /> FTPS</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89119" target="_blank">Virtual<br /> Hosts</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89119" target="_blank">True<br /> HOSTs</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Site<br /> Manager</th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Extensibility</th></tr>
<tr>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://www.netdrive.net/" target="_blank">NetDrive 2.3.2</a></td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">N/A</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Y</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">N<sup>1</sup></td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Y</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">N<sup>2</sup></td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Y</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">N/A</td>
</tr>
<tr>
<td colspan="8" align="left" valign="top">Notes:<ol>
<li>Despite several attempts, I could not get NetDrive to work with Implicit FTPS.</li>
<li>I could find no way to customize an FTP connection in order to enable true FTP hostnames.</li>
</ol></td>
</tr>
</tbody>
</table>
<p>That wraps things up for today's review of <em style="font-style: italic;">NetDrive 2.3</em>. Your key take-aways should be: <em style="font-style: normal;">NetDrive has some nice features, and it supports a wide variety of protocols with a similar user experience</em><span style="font-style: normal;"><em style="font-style: normal;">;</em></span> that being said, NetDrive has very few settings for drive connections, so its capabilities are somewhat limited.</p>]]></content:encoded>
    </item>
    <item>
      <title>FTP Clients - Part 15: WebDrive</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/ftp-clients-part-15-webdrive</link>
      <pubDate>Sun, 30 Nov 2014 01:39:09 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2014/11/30/ftp-clients-part-15-webdrive/</guid>
      <description><![CDATA[For the next installments in my series about FTP clients, I will be taking a look at two FTP...]]></description>
      <content:encoded><![CDATA[<p>For the next installments in my series about FTP clients, I will be taking a look at two FTP redirectors at the same time. In this specific blog post, I will focus on WebDrive (from South River Technologies), whereas my next post will look at NetDrive (from Bdrive Inc.).</p>
<p>At the time of this blog's writing, WebDrive is a for-retail FTP client and redirector which is available from the following URL:</p>
<p style="margin-left: 20px;"><a href="http://www.webdrive.com/" target="_blank">http://www.webdrive.com/</a></p>
<p>For this blog post I will be using WebDrive version 12.10.4082.</p>
<h3>WebDrive 12 Overview</h3>
<p>Before I continue, I would like to begin with some background information: because of my ongoing blog series about FTP clients, one question that I have often been asked is, "Which FTP client do <em>you </em>use?" Usually I have to answer, "That depends." I know that my answer sounds non-committal, but to be honest - I have yet to find an FTP client that does <em>everything</em> that I want, although a few FTP clients have had enough features for me to use them quite often. And with that in mind, I need to point out that I purchased my first license for WebDrive over 12 years ago, and over the years I have periodically renewed my license for later versions. So to partially answer my earlier question - WebDrive is one of the FTP clients that I have used a lot.</p>
<p>That being said, WebDrive is different from many of the other FTP clients that I have reviewed because it is an Internet protocol redirector, meaning that it allows you to map drive letters to a variety of Internet-based repositories. (I'll discuss those various protocols and repositories shortly.)</p>
<p>When you install and open WebDrive, you are presented with a fairly empty user interface:</p>
<p style="margin-left: 20px;"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pVUNGsa-o8tOsZNKR_Ks-ikkQhZ4gCsnAaNLQbAlsxMn5y78gCD4xVQ-86iw42rEQb78sq9VzRMLVzPedlECC7s4zG2OvVcMI60m2ChL3dD8/WebDrive01.png" alt="" width="426" height="480" /></p>
<p>If you click the <strong>App Settings</strong> icon, you will be presented with a dialog box that offers dozens of customizable options:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2poLyRN-owXpBnBuLDfjVw6eJMf3-7QiXxILmlhjXOwy3S-gQuVpTqe3TQqgL29EPnkwG_jv73FVE8Q9xS1cIwM3RvfpqRJoO0jyB6WxL6_r4/WebDrive03.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2poLyRN-owXpBnBuLDfjVw6eJMf3-7QiXxILmlhjXOwy3S-gQuVpTqe3TQqgL29EPnkwG_jv73FVE8Q9xS1cIwM3RvfpqRJoO0jyB6WxL6_r4/WebDrive03.png" alt="" width="450" height="423" /></a></p>
<p>When you click the <strong>New</strong> icon, you will be presented with a <strong>Site Wizard</strong> which lists the supported Internet protocols and repositories which you can use for mapping drives:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pEiiZTlxfPhp-ZzgQ5X-WOy9R9b6P0nPBYmRMnZ9m4iRacvpXPLuR_gxzV7JGzeECE_uAkP6HxxKbjR3pgKUITE-q2l7_WFlIHXA8epu9elk/WebDrive02.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pEiiZTlxfPhp-ZzgQ5X-WOy9R9b6P0nPBYmRMnZ9m4iRacvpXPLuR_gxzV7JGzeECE_uAkP6HxxKbjR3pgKUITE-q2l7_WFlIHXA8epu9elk/WebDrive02.png" alt="" width="450" height="398" /></a></p>
<p>As you can see from the illustration above, WebDrive's list of support technologies is quite extensive: WebDAV, Secure WebDAV, FTP, Secure FTP, Google Drive, Amazon S3, SFTP, Dropbox, and FrontPage Server Extensions.</p>
<p>When you choose to create an FTP connection, WebDrive launches its <strong>Site Wizard</strong>, and the initial dialog box is pretty self-explanatory:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pyWRcTxYWHNmbNJEFwgjGUEMOLM9cp6vuDShkQ7Rk2zXKoTUuifxFFjBh58mWbISl5HJaRLwXaKpJHgkSzsggzY6TcE970UM13AknaEHHQQM/WebDrive04.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pyWRcTxYWHNmbNJEFwgjGUEMOLM9cp6vuDShkQ7Rk2zXKoTUuifxFFjBh58mWbISl5HJaRLwXaKpJHgkSzsggzY6TcE970UM13AknaEHHQQM/WebDrive04.png" alt="" width="450" height="398" /></a></p>
<p>However, when you click the <strong>Advanced Settings</strong> button, you are presented once again with dozens of customizable settings for this specific connection:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pdW1jijsuE7mAbLFhQN-aZgDqsSnLM9PNZ1Z4Xnargp_A5vd_kFgZq6DHxgw-Fio_PypuknG4sUT4UepDkpCdTXzvgV9WTLtQ5En2fTtmYeo/WebDrive05.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pdW1jijsuE7mAbLFhQN-aZgDqsSnLM9PNZ1Z4Xnargp_A5vd_kFgZq6DHxgw-Fio_PypuknG4sUT4UepDkpCdTXzvgV9WTLtQ5En2fTtmYeo/WebDrive05.png" alt="" width="450" height="442" /></a></p>
<p>As you continue to add sites with WebDrive, their connection types and current statuses are displayed in the user interface:</p>
<p style="margin-left: 20px;"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pxq8W5KbRaiHJCHFyOenZjhtvIHFDOgnFyXd9hkPMsDwrESLvipJ_U4Pl5WEcThR5Hh8WfDpgv1QrUSmKaMeV8pxnWOe8qtO9AWz2qB-CHTM/WebDrive06.png" alt="" /></p>
<p>However, when you view your drives in Windows Explorer, even though network drives which are mapped through WebDrive are displayed with a different icon, you cannot tell the protocol type for mapped drives; this is one of the few times where NetDrive supported a feature that I really missed in WebDrive. (See my next blog entry for more information.)</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pehAMWxOkti0e-i3ZAX75NyDukwabknCkOJrgrT85hkO_McgqKBI5O52ALOkjRoAZIuOZC4xcQwYeZ8HyCFVo5trA_tI_MU8yOaglHhvXOC0/WebDrive07.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pehAMWxOkti0e-i3ZAX75NyDukwabknCkOJrgrT85hkO_McgqKBI5O52ALOkjRoAZIuOZC4xcQwYeZ8HyCFVo5trA_tI_MU8yOaglHhvXOC0/WebDrive07.png" alt="" width="450" height="315" /></a></p>
<p>WebDrive 12 supports command-line scripting, so if you find the features of the built-in Windows FTP client are somewhat limited, you can investigate scripting WebDrive:</p>
<p style="margin-left: 20px;"><a href="http://www.webdrive.com/support/webdrive/v12/Content/WebDrive/Advanced/Command%20Line%20Parameters.htm" target="_blank">WebDrive Command Line Parameters</a></p>
<p>I would love to take an in-depth look at all of the supported protocols in this review, but this series is about FTP clients, so I'll move on to the FTP-specific features that I normally review.</p>
<h3>Using WebDrive 12 with FTP over SSL (FTPS)</h3>
<p>WebDrive 12 has built-in support for FTP over SSL (FTPS), and it supports both <a href="http://blogs.msdn.com/robert_mcmurray/archive/2008/11/10/ftp-clients-part-2-explicit-ftps-versus-implicit-ftps.aspx" target="_blank">Explicit and Implicit FTPS</a>. To specify which type of encryption to use for FTPS, you need to choose the appropriate option from the <strong style="font-weight: bold;">Security Type</strong> drop-down menu in the <strong>FTP Settings</strong> for a site:</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pxY8wrcV4Tnq2O-8r6LT59RUAVfuL738w7l9tbGe8IDgCg7Z81-HUGcK1yWyyFBelu9AkmjFxUUSol1sFykVkCQe8Dt_AmPpg8RigwbPtTY4/WebDrive08.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pxY8wrcV4Tnq2O-8r6LT59RUAVfuL738w7l9tbGe8IDgCg7Z81-HUGcK1yWyyFBelu9AkmjFxUUSol1sFykVkCQe8Dt_AmPpg8RigwbPtTY4/WebDrive08.png" alt="" width="450" height="442" /></a></p>
<h3>Using WebDrive 12 with True FTP Hosts</h3>
<p>True FTP hosts are not supported natively by WebDrive 12, and there are no settings that I could find which would allow me to customize the login environment in order to work around this situation.</p>
<h3>Using WebDrive 12 with Virtual FTP Hosts</h3>
<p>WebDrive 12's login settings allow you to specify the virtual host name as part of the user credentials by using syntax like "ftp.example.com|username" or "ftp.example.com\username", so you can use virtual FTP hosts with WebDrive 12.</p>
<p style="margin-left: 20px;"><a href="https://yy0ipa.dm2302.livefilestore.com/y2pp-XsgmWuquzFSJvFhtKJy-AJaHVdjFaNuZ8NPTN6ta_mdHuAL3BFZkfmMiaxWT7id01w8n0pYig-iR7Fz3emEudVyYf0PFzm8Mioz2-5dtc/WebDrive09.png" target="_blank"><img src="https://yy0ipa.dm2302.livefilestore.com/y2pp-XsgmWuquzFSJvFhtKJy-AJaHVdjFaNuZ8NPTN6ta_mdHuAL3BFZkfmMiaxWT7id01w8n0pYig-iR7Fz3emEudVyYf0PFzm8Mioz2-5dtc/WebDrive09.png" alt="" width="450" height="442" /></a></p>
<h3>Scorecard for WebDrive 12</h3>
<p>This concludes my quick look at a few of the FTP features that are available with <em style="font-style: italic;">WebDrive 12</em>, and here are the scorecard results:</p>
<table style="background: #ffffff; border: 2px solid #000000; width: 450px; color: #000000; margin-left: 20px; border-collapse: collapse; border-image: none;">
<tbody>
<tr><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Client<br /> Name</th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Directory<br /> Browsing</th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89117" target="_blank">Explicit<br /> FTPS</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89117" target="_blank">Implicit<br /> FTPS</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89119" target="_blank">Virtual<br /> Hosts</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://go.microsoft.com/fwlink/?LinkId=89119" target="_blank">True<br /> HOSTs</a></th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Site<br /> Manager</th><th style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Extensibility</th></tr>
<tr>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap"><a href="http://www.webdrive.com/" target="_blank">WebDrive 12.10.4082</a></td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">N/A</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Y</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Y</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Y</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">N<sup>1</sup></td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">Y</td>
<td style="border-image: none; color: #000000; border: 2px solid #000000; background: #ffffff;" align="center" valign="middle" nowrap="nowrap">N/A</td>
</tr>
<tr>
<td colspan="8" align="left" valign="top">Notes:<ol>
<li>True FTP hosts are not supported natively, and I could find no way to customize an FTP connection in order to enable true FTP hostnames.</li>
</ol></td>
</tr>
</tbody>
</table>
<p>That wraps things up for today's review of <em style="font-style: italic;">WebDrive 12</em>. Your key take-aways should be: <em style="font-style: normal;">WebDrive is a powerful redirector with support for a wide variety of protocols</em>. What's more, the WebDrive application and each individual connection contain dozens of options which allow you to customize the environment in hundreds of ways. As is the case with many of my reviews, I have barely presented a fraction of the capabilities that are available in WebDrive 12; you might want to try it out and experiment with all of its possibilities.</p>]]></content:encoded>
    </item>
    <item>
      <title>Using the WebDAV Redirector with OneDrive Part 2 - Two-Step Verification</title>
      <link>https://docs.microsoft.com/archive/blogs/robert_mcmurray/using-the-webdav-redirector-with-onedrive-part-2-two-step-verification</link>
      <pubDate>Tue, 30 Sep 2014 01:21:00 GMT</pubDate>
      <dc:creator><![CDATA[robmcm]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/robert_mcmurray/2014/09/30/using-the-webdav-redirector-with-onedrive-part-2-two-step-verification/</guid>
      <description><![CDATA[This blog is Part 2 of a series about mapping a drive letter to your OneDrive account. In Part 1 of...]]></description>
      <content:encoded><![CDATA[<p>This blog is Part 2 of a series about mapping a drive letter to your OneDrive account. In <a href="http://blogs.msdn.com/b/robert_mcmurray/archive/2014/09/30/using-the-webdav-redirector-with-onedrive-part-1-standard-security.aspx" target="_blank">Part 1</a> of this series, I showed you how to map a drive letter to your OneDrive account when you are using standard security, and in this blog I will show you how to map a drive letter to your OneDrive account after you have enabled two-step verification for your account security. The process is largely similar, with the notable exception that you need to generate an application password which you will use when you are mapping the drive letter with the WebDAV Redirector.</p>  <p>A quick note about two-step verification: enabling this security feature adds an additional requirement so that you will need to use a secondary method to verify your identity when you are logging in. (For example, you can use a <a href="http://go.microsoft.com/fwlink/?LinkId=393635" target="_blank">phone app</a>, text message, or second email account.) However, you cannot use a secondary login method when you are using the WebDAV Redirector, so you will need to create an application password. (Note: More information about two-step verification for your Microsoft is available in the <em><a href="http://go.microsoft.com/fwlink/?LinkID=276854" target="_blank">Two-step verification: FAQ</a></em>.)</p>  <h3>Step 1 - Log Into Your OneDrive Account</h3>  <p>The first thing that you need to do is to browse to <a title="https://onedrive.live.com/" href="https://onedrive.live.com/">https://onedrive.live.com/</a> and sign in with your Windows account.</p>  <h3>Step 2 - Determine Your OneDrive Customer ID</h3>  <p>Once you have logged in to your OneDrive account, hover your mouse over the <strong>Files</strong> link on the left part of your browser window – this will show your customer number in the status bar on the bottom of your browser window. If you have the status bar disabled, you can right-click the <strong>Files</strong> link and click <strong>Copy Shortcut</strong> in the pop-up menu. (Note: Those instructions are for Internet Explorer, but the method should be similar in Chrome or Firefox.)</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2puZ28vil4ujnkWbUc1YXkV9QSVjyEIi60kj5HXWXLsZBO0f8gbQBVMDWt4AG0WfGdcqgsqcAJcRr5Ybo7wmMeWMCNFKHdtoR7uJuHPxCLyu4/WebDAV-OneDrive-01.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2puZ28vil4ujnkWbUc1YXkV9QSVjyEIi60kj5HXWXLsZBO0f8gbQBVMDWt4AG0WfGdcqgsqcAJcRr5Ybo7wmMeWMCNFKHdtoR7uJuHPxCLyu4/WebDAV-OneDrive-01.png" width="450" height="337" /></a> </p>  <p>Your Customer ID is the value that is specified after the &quot;cid=&quot; in the URL; for example: &quot;https://onedrive.live.com/?cid=426f62526f636b73&quot;. You will need this value when you map a drive letter.</p>  <h3>Step 3 - Generate an Application Password</h3>  <p>To map a WebDAV drive to your OneDrive account after you have enabled two-step account verification, you will need to generate an application password which you will use when you enter your credentials. (Note: More information about two-step verification can be found in the <em><a href="http://go.microsoft.com/fwlink/?LinkID=277093" target="_blank">App passwords and two-step verification</a></em> article.)</p>  <p>To generate an application password, you first need to log into your Microsoft account settings at <a href="https://account.live.com/">https://account.live.com/</a>:</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2p5T-5hHb87rxJHoDHuYJ7s27hpBG2eHpj-GyiFuDUvjPl5JfdFD0BlpyvxOPB4Anx8PE6zjuimUpJfUYkZdSqHY1MK0VDgSVGJcR2XHqFuGE/WebDAV-OneDrive-07.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2p5T-5hHb87rxJHoDHuYJ7s27hpBG2eHpj-GyiFuDUvjPl5JfdFD0BlpyvxOPB4Anx8PE6zjuimUpJfUYkZdSqHY1MK0VDgSVGJcR2XHqFuGE/WebDAV-OneDrive-07.png" width="450" height="337" /></a> </p>  <p>Once you have logged in, click on <strong>Security &amp; password</strong> and then <strong>Create a new app password</strong>:</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2pU_6JfOmSclLqPpTuZJ-WVB4l6zkLHdP3VQ6jez-1BjBnsRmfVOjaXSOU1S9jOV_lbbhyPrv6V7S5jAIVHejCCvROv2BXapWxeS20PW9bZg4/WebDAV-OneDrive-08.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2pU_6JfOmSclLqPpTuZJ-WVB4l6zkLHdP3VQ6jez-1BjBnsRmfVOjaXSOU1S9jOV_lbbhyPrv6V7S5jAIVHejCCvROv2BXapWxeS20PW9bZg4/WebDAV-OneDrive-08.png" width="450" height="337" /></a> </p>  <p>When the app password page is displayed, copy the password for later:</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2pjrelDKQbL0zeMvdI4N6jvqL8TAC5sYc3vQSHtg4nEaYAtFB-spPQYHoGXnPt9eotWIB4Hv2dPFIfUMiLwTYmjnvupTqKQ0NABxETNo8ZN4Q/WebDAV-OneDrive-09.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2pjrelDKQbL0zeMvdI4N6jvqL8TAC5sYc3vQSHtg4nEaYAtFB-spPQYHoGXnPt9eotWIB4Hv2dPFIfUMiLwTYmjnvupTqKQ0NABxETNo8ZN4Q/WebDAV-OneDrive-09.png" width="450" height="337" /></a> </p>  <h3>Step 4 - Map the Drive Letter</h3>  <p>Your next step is to map the drive letter, and there are a few ways to do this. I have documented several methods in my <em><a href="http://www.iis.net/learn/publish/using-webdav/using-the-webdav-redirector" target="_blank">Using the WebDAV Redirector</a></em> article on the IIS.net website, but I will show a few ways in this blog.</p>  <h4>Method #1 - Using the Windows User Interface and Wizards</h4>  <p>On most of my systems I have the <strong>Network</strong> and <strong>This PC</strong> or <strong>My Computer</strong> icons on my desktop, which makes it easy to simply right-click one of those icons and select <strong>Map network drive</strong>:</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2ptqam0Ws9ztNFS8MVn1uHge6KZuJrORtKZcA0QjkIcbVIQJgUuSKg6nukG-zy2dp_utZR-YYXcuqJGMUTzOT_wL2q53NapjHhhlbr5fTnbx8/WebDAV-OneDrive-02.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2ptqam0Ws9ztNFS8MVn1uHge6KZuJrORtKZcA0QjkIcbVIQJgUuSKg6nukG-zy2dp_utZR-YYXcuqJGMUTzOT_wL2q53NapjHhhlbr5fTnbx8/WebDAV-OneDrive-02.png" width="450" height="400" /></a> </p>  <p>An alternate method on Windows 8 is to open <strong>This PC</strong> and <strong>Map network drive</strong> will be listed as an icon on the Windows Explorer ribbon:</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2pUWA2ex1f8e0ZjzobFq0iBvVZX1J4SrLqRTh203HvEsYkWVTdCpnim00lyx3Dt3WkGled3eWpwisNakKT7H78ifsCIjrnPVsjEyFRy8N7HPE/WebDAV-OneDrive-03.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2pUWA2ex1f8e0ZjzobFq0iBvVZX1J4SrLqRTh203HvEsYkWVTdCpnim00lyx3Dt3WkGled3eWpwisNakKT7H78ifsCIjrnPVsjEyFRy8N7HPE/WebDAV-OneDrive-03.png" width="450" height="337" /></a></p>  <p>Once the Map Network Drive Wizard appears, enter &quot;https://d.docs.live.net/&quot; followed by your Customer ID from Step 2. For example: &quot;https://d.docs.live.net/426f62526f636b73/&quot;</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2p_cWD3S5FSouf4-7YQPDnrZdVZ6SHGJFNaduavEU1CBCUgNkfWYdKe--BASa_BJ1SbHSnzRISsv1igmFr1kPLDK3KZGeBoneJLKAcFNDo-Xk/WebDAV-OneDrive-04.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2p_cWD3S5FSouf4-7YQPDnrZdVZ6SHGJFNaduavEU1CBCUgNkfWYdKe--BASa_BJ1SbHSnzRISsv1igmFr1kPLDK3KZGeBoneJLKAcFNDo-Xk/WebDAV-OneDrive-04.png" width="450" height="333" /></a></p>  <p>When the Windows Security dialog box appears, enter your email address that you used to log into your OneDrive account in Step 1 and the application password that you created in Step 3.</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2pTKG29VNriNf10NqO6Ws3IsJLEpbk7gEkGFGcEamaQKVH3AUDD_9PFgSs-eBdKOm2JF0Vb3qJZQ9eK-_zkKXNR4wT6ob8JOh5S_BkbOmLgiI/WebDAV-OneDrive-05.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2pTKG29VNriNf10NqO6Ws3IsJLEpbk7gEkGFGcEamaQKVH3AUDD_9PFgSs-eBdKOm2JF0Vb3qJZQ9eK-_zkKXNR4wT6ob8JOh5S_BkbOmLgiI/WebDAV-OneDrive-05.png" width="439" height="294" /></a></p>  <p>Once the mapping has been completed, you will be able to view your OneDrive files in Windows Explorer via the mapped drive:</p>  <p style="margin-left: 20px"><a href="https://1kagaa.dm2302.livefilestore.com/y2pVDfGRQSbSj6ADqpGATVRCHJ3Z-wJxiN-0XT8rWtdPfXMI-gr6g5mjlPQedHvhvj51Cvg781n09XtWFuPvVkFkhZCmFc4XNMIzB5YC8HcS_4/WebDAV-OneDrive-06.png" target="_blank"><img src="https://1kagaa.dm2302.livefilestore.com/y2pVDfGRQSbSj6ADqpGATVRCHJ3Z-wJxiN-0XT8rWtdPfXMI-gr6g5mjlPQedHvhvj51Cvg781n09XtWFuPvVkFkhZCmFc4XNMIzB5YC8HcS_4/WebDAV-OneDrive-06.png" width="450" height="337" /></a></p>  <h4>Method #2 - Using the Windows Command Line</h4>  <p>You can also map a WebDAV drive letter to your OneDrive account from a command line. The general syntax is listed below:</p>  <table style="border-top: #666 5px solid; border-right: #666 5px solid; border-collapse: collapse; border-bottom: #666 5px solid; margin-left: 20px; border-left: #666 5px solid; background-color: #000; border-image: none" border="5"><tbody>     <tr>       <td>         <pre style="color: #fff; padding-bottom: 5px; padding-top: 5px; padding-left: 5px; padding-right: 5px; background-color: #000"><strong> <br />C:\&gt;net use * https://d.docs.live.net/xxxxxxxxxxxxxxxx/ /user:&quot;user@example.com&quot; &quot;password&quot;</strong><br />&#160;</pre>
      </td>
    </tr>
  </tbody></table>

<p>For example:</p>

<table style="border-top: #666 5px solid; border-right: #666 5px solid; border-collapse: collapse; border-bottom: #666 5px solid; margin-left: 20px; border-left: #666 5px solid; background-color: #000; border-image: none" border="5"><tbody>
    <tr>
      <td>
        <pre style="color: #fff; padding-bottom: 5px; padding-top: 5px; padding-left: 5px; padding-right: 5px; background-color: #000"><strong>C:\&gt;net use * https://d.docs.live.net/426f62526f636b73/ /user:&quot;bob@contoso.com&quot; &quot;426f62526f636b73&quot;

C:\&gt;dir
 Volume in drive Z has no label.
 Volume Serial Number is 0000-0000

 Directory of Z:\

09/02/2014 10:38 PM &lt;DIR&gt; Applications
09/27/2014 08:43 AM &lt;DIR&gt; Blog Photos
09/29/2014 10:50 PM &lt;DIR&gt; Documents
08/17/2014 03:44 AM &lt;DIR&gt; Pictures
09/22/2014 05:58 PM &lt;DIR&gt; Public
09/29/2014 10:43 AM &lt;DIR&gt; SkyDrive camera roll

C:\&gt;</strong></pre>
      </td>
    </tr>
  </tbody></table>

<p>That wraps it up for Part 2 of this blog series - I hope this helps!</p>]]></content:encoded>
    </item>
  </channel>
</rss>