title: How can I programmatically convert a DFS path to UNC using VBS?
body: <p>I have several scripts that must use UNC paths - not DFS - and would like to be able to determine the UNC path programmatically from the DFS path. For example, we have something like:</p>
  
  <pre><code>\\domain\fs\Home\HomeFolder\MyUserID
  </code></pre>
  
  <p>and I would like to get from it the UNC path like this:</p>
  
  <pre><code>\\Server1\HomeFolder\MyUserID
  </code></pre>
  
  <p>I cannot count on a utility like DFSUtil.exe to be available. It will need to be in VBScript.</p>
  
  <p>I found the following code in NET which uses WMI but I can't tease out what's happening to convert it to a usable VBS:
  <a href="http://www.codeproject.com/Tips/158829/Convert-a-file-path-to-a-UNC-Path" rel="nofollow">http://www.codeproject.com/Tips/158829/Convert-a-file-path-to-a-UNC-Path</a></p>
  
  <p>Can anyone lend a hand? I'm lost in translation (don't speak NET)...</p>