Results 1 to 3 of 3

Thread: [2005] Changing priorty of programs started but VB program

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    163

    [2005] Changing priorty of programs started but VB program

    I'm making a GUI for running some other programs and batch scripts. I'd like to know if I can change the priority that they are run at. So the user can either lower or higher the priority to their needs with out having to use the task manager each time a new program is run. This runs other programs as batches so it could run the same program 20 times. I just though of something I don't think there's an easy way to control the priority of the programs i start via batch scripts. I do that since they have complicated arguments and I can't get them to work right starting them from the VB program.

    Also when another program is started the main form can not be moved or minimized while the program is running. I assume this is because I have a wait fo exit so it runs one instance of program at a time. Is there a way to allow the form to be moved or minimized while running another program and just lock changing or clicking on the form?

    For the mean time I'm going to look into just minimizing the form while other programs are running. I'd assume that'd be the form.minimize or something close to that, I hope. got it Me.WindowState = blah blah blah


    example of how i'm starting a program
    Code:
            Dim myDir As New System.IO.DirectoryInfo(mainfolder.Text)
            Dim fn As String
            Dim dgindexexe As String = dgindex.Text
    
            For Each myFile As System.IO.FileInfo In myDir.GetFiles("*.vob")
                fn = mainfolder.Text & "\" & myFile.Name
                If System.IO.File.Exists(dgindexexe) Then
                    Dim oProcess As System.Diagnostics.Process
                    Dim oPSI As New System.Diagnostics.ProcessStartInfo
                    oPSI.FileName = dgindex.Text
                    oPSI.Arguments = "-AIF=[" & fn.Substring(0, fn.Length - 4) & ".vob] -IA=6 -fo=0 -yr=1 -OM=2 -OF=[" & fn.Substring(0, fn.Length - 4) & "] -exit"
                    oProcess = Process.Start(oPSI)
                    oProcess.WaitForExit()
                Else
                    MsgBox(dgindexexe & " was not found")
                End If
            Next

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Changing priorty of programs started but VB program

    Set the PriorityClass of your Process.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2008
    Posts
    163

    Re: [2005] Changing priorty of programs started but VB program

    thanks I'll look that up and try it soon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width