title: Program Working On C:\ But Not E:\
body: <p>I wrote a simple program in VB 2017 that is meant to gather data about my computer's internet connection to be used in a later script, in an attempt to fix an ip issue. The program is meant to be run from my Desktop, which is on my E:\ Drive instead of C:\ On the main drive (C:), the program executes perfectly and outputs the wanted information into a text file, but on E:, the program simply creates the text files, but leaves them blank. The code is as follows:</p>
  
  <pre><code>Imports System.IO
  
  Public Class Form1
  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      'Creates path for output file &amp; cmd process
      Dim path As String = My.Application.Info.DirectoryPath() &amp; "\ExIpOutput.txt"
      Dim path1 As String = My.Application.Info.DirectoryPath() &amp; "\Ipconfig.txt"
      Dim pathSub As String = path.Substring(2, 3)
      Dim path1Sub As String = path1.Substring(2, 3)
  
      'Creates output files
      Dim fs As FileStream = File.Create(path)
      fs.Close()
      Dim fs1 As FileStream = File.Create(path1)
      fs1.Close()
  
      'Declares the ExIP Program
      Dim psi As New ProcessStartInfo With {
          .Verb = "runas",
          .FileName = "Cmd",
          .Arguments = "/c" &amp; "nslookup myip.opendns.com. resolver1.opendns.com" &amp; "&gt; " &amp; path
      }
      'Attempts to run the program
      Process.Start(psi)
  
      'Declares the IPConf Program
      Dim psi1 As New ProcessStartInfo With {
          .Verb = "runas",
          .FileName = "Cmd",
          .Arguments = "/c" &amp; "ipconfig /all" &amp; "&gt; " &amp; path1
      }
      'Attempts to run the program
      Process.Start(psi1)
  
  End Sub
  End Class
  </code></pre>
  
  <p>What I've tried/Debugged:</p>
  
  <p>I originally thought it was an issue with the path, being <code>E:\\</code> Instead of <code>E:\</code>, but after writing an annoyingly complex Function to repair the path, the same result occurred. I am running in both locations with administrative permissions, and the same exact .exe file. The command prompt seems to run fine. Not sure what's up.</p>