Question : How to export ipconfig results to a text file via VB.net

Hi,
I am trying to programatically(VB.net) create a file with all ipconfig data, just like the cmd command ipconfig /all >
I used this code, but no file has been created:  
  With pStart.StartInfo
                .UseShellExecute = True
                 .FileName = "cmd.exe"
                .Arguments = "ipconfig.exe /ALL >" + outputPath
            End With

            ' Execute the process and wait for it to exit
            If pStart.Start() Then
                pStart.WaitForExit()
            End If

Any suggestions?

Thanks

Answer : How to export ipconfig results to a text file via VB.net

The first argument should be /C

Try use the full path of the IP Config utility - C:\windows\system32\ipconfig.exe
And the full path of the CMD.EXE - C:\windows\system32\cmd.exe


                 .FileName = "C:\\windows\\system32\\cmd.exe"
                .Arguments = "/C C:\\windows\\system32\\ipconfig.exe /ALL >" + outputPath

Good luck
Random Solutions  
 
programming4us programming4us