I'm writing a small app to collect IE command diag. The problem is it's not waiting till the process finishes and it's errors out in the next line. My goal is to copy the log and paste it under a folder in Desktop
Try
Process.Start("C:\Program Files\Internet Explorer\iediagcmd.exe")
My.Computer.FileSystem.CopyFile(USERPROFILE & "\Desktop\IEDiag.cab", USERPROFILE & "\Desktop\W8\IEDiag.cab",
Microsoft.VisualBasic.FileIO.UIOption.AllDialogs,
Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
My.Computer.FileSystem.DeleteFile(USERPROFILE & "\Desktop\IEDiag.cab")
MsgBox("IE Logs copied sucessfully")
Catch ex As Exception
MsgBox("Error copying file: " & ex.Message)
End Try
What am I doing wrong. And please bear in mind i'm a rookie in VB.
Thanks,