i tried that and all i got was a mess....heres my code:
Dim defrag As New Process
Dim defragSI As New ProcessStartInfo("C:\windows\system32\cmd.exe")
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
defrag.StartInfo = defragSI
defrag.StartInfo.UseShellExecute = False
defrag.StartInfo.RedirectStandardInput = True
defrag.Start()
Try
defrag.StandardInput.WriteLine("defrag c: /f")
defrag.WaitForExit()
Catch ex As Exception
End Try
End Sub
and all that happens is my form and the command prompt, for some reason,
loop and make a new prompt and form over and over. what am i doin wrong?