title: Setting the name of a SUBST drive using VBS
body: <p>I'm using SUBST to create a drive letter representing a path on a local drive. </p>
  
  <pre><code>subst Q: "C:\Users\Username\My Documents\blah\blah\blah"
  </code></pre>
  
  <p>I want to label the new drive E: with a descriptive name different than the volume name of C: 
  This cannot be done through Explorer, or using the LABEL command. </p>
  
  <p>A solution is offered in this <a href="https://stackoverflow.com/questions/12608840/naming-a-drive-with-a-batch-file">question from 2012</a>. It includes a snippet of VBS code to set a drive name in the comments. @SeanC implied that it worked properly back then. </p>
  
  <p>The code looks like this when expanded:</p>
  
  <pre><code>mDrive = "q:\"
  Set oShell = CreateObject("Shell.Application")
  oShell.NameSpace(mDrive).Self.Name = "AnyName"
  </code></pre>
  
  <p>In 2019, under Windows 10, this code does not work:</p>
  
  <pre><code>C:\Label_drive.vbs(3, 1) Microsoft VBScript runtime error: Object required: 'oShell.NameSpace(...)'
  </code></pre>
  
  <p>I'm not at all familiar with VBS - can anyone identify the problem with the script? What has changed that would cause this error now? </p>
  
  <p>Edit: This command is run from an administrator (elevated) command window prompt:</p>
  
  <pre><code>cscript Label_drive.vbs
  </code></pre>