Question How do I get feedback from running process?

Kayot

Well-known member
Joined
Mar 6, 2007
Messages
49
Programming Experience
3-5
I've made a small utility that I've been using to help assist me in organizing my massive achieve. It works fine, however it's a little annoying that I don't get any feedback.

All of the programs are console. What I'd like is a way to see what the programs are doing. Right now all I see is the courser flashing then the > for another input command.

The code I'm using to run external programs:
VB.NET:
    Sub run_program_wait(ByVal sExe As String, ByVal sParam As String)
        Console.WriteLine(String.Format("Processing: {0} {1}", sExe, sParam))

        Dim p As New Process()
        With p.StartInfo
            .FileName = sExe
            .Arguments = sParam
            .CreateNoWindow = True
            .WindowStyle = ProcessWindowStyle.Hidden
        End With

        p.Start()
        Do Until p.HasExited

        Loop

    End Sub

I have it setup to hide the running programs since it's a bit annoying to have a dos window pop up 2,185 times while I'm trying to do something else.

I did have it setup to redirect the console of the running applications to the console app, but when I did that, the command started failing.

The programs I'm running are rar.exe and 7za.exe, both are the console versions. Both have arguments. Any suggestions would be much appreciated. If it's not easily possible it's not really a big deal. It would just be nicer to see what's happening and be able to see if it hangs on some miscellaneous error.

P.S. It's a loose program tailored to my needs, but if any one wants a copy of the source I'll gladly supply it. It uses a form control to capture the clipboard. Total Commander has a command that will spill the selected file/folder paths to the clipboard which my program uses to do various things such as testing an archive to get it to the smallest size and moving all sub folder files to the listed path. It's useful useless.
 
I actually already tried that one back when this was a form application. The problem was that for some reason, even when I assembled the command and it looked correct it wouldn't run right. Then when it did run right instead of a smooth output it would fetch the next line over and over due to rar.exe and 7za.exe updating the line with % complete.

To be honest, I don't think it's possible to do what I want due to the way the programs involved draw their outputs. Short of getting the source codes for commercial programs of course :cool:
 

Latest posts

Back
Top