CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Question Regarding Process execution

    Hi

    I have to execute a batch file and it produces a lot of info on the command line. I have to get all those info in a txt file. How to accomplish this in VB .NET?

    In vc++, I've been creating a process with read and write pipes and reading the contents into a txt file.

    I've to do a similar thing in VB .NET. Can anyone help me with this?

    Regards,
    Bharani..

  2. #2
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: Regarding Process execution

    Tutorials: Home & Learn | Start VB.NET | Learn VB.NET | C# Station | GotDotNet | Games in VB.NET 101 Samples: 2002 | 2003 | 2005 | More .NET 2.0 (VB.NET, C#) Articles: VB.NET | C# | ASP.NET | MoreFree Components: WFC | XPCC | ElementsEx | VBPP | Mentalis | ADO.NET/MySQL | VisualStyles | Charting (NPlot, ZedGraph) | iTextSharp (PDF) | SDF (CF) ● Free Literature: VB 2005 (eBook) | VB6 to VB.NET (eBook) | MSDN Magazine (CHM format) ● Bookmarks: MSDN | WinForms .NET | ASP.NET | WinForms FAQ | WebForms FAQ | GotDotNet | Code Project | DevBuzz (CF) ● Code Converter: C#/VB.NET | VB.NET/C# | VS 2005 add-in

  3. #3
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Re: Regarding Process execution

    Hi
    The example is nice and it works fine. But this is not what i need.
    I have a CM tool with me. Dimensions. And I can connect it through command line
    Code:
    dmcli -file filename -param paramfile
    And in my vc++ approach, I used to get the things the dimensions command mode used to throw me. But here I get only the codes which the windows commandline throw!

    Regards
    Bharani
    Rate the posts which you find useful

  4. #4
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: Regarding Process execution

    I have no idea what you mean.
    Tutorials: Home & Learn | Start VB.NET | Learn VB.NET | C# Station | GotDotNet | Games in VB.NET 101 Samples: 2002 | 2003 | 2005 | More .NET 2.0 (VB.NET, C#) Articles: VB.NET | C# | ASP.NET | MoreFree Components: WFC | XPCC | ElementsEx | VBPP | Mentalis | ADO.NET/MySQL | VisualStyles | Charting (NPlot, ZedGraph) | iTextSharp (PDF) | SDF (CF) ● Free Literature: VB 2005 (eBook) | VB6 to VB.NET (eBook) | MSDN Magazine (CHM format) ● Bookmarks: MSDN | WinForms .NET | ASP.NET | WinForms FAQ | WebForms FAQ | GotDotNet | Code Project | DevBuzz (CF) ● Code Converter: C#/VB.NET | VB.NET/C# | VS 2005 add-in

  5. #5
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Re: Regarding Process execution

    Sorry.. i dont get thro the code fully .. it nice
    thnx
    Bharani..
    Rate the posts which you find useful

  6. #6
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Re: Regarding Process execution

    Hi

    Here if i create five threads, they run parallely. What should i have to do if the threads should execute one after another?

    thnx,
    bharani..
    Rate the posts which you find useful

  7. #7
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Re: Regarding Process execution

    Quote Originally Posted by ajbharani
    Hi

    Here if i create five threads, they run parallely. What should i have to do if the threads should execute one after another?

    thnx,
    bharani..
    What i mean is

    if i write a code like this,
    Code:
    ExecuteProcess("prc.bat")
    msgbox("hello")
    the msgbox should be displayed only after the process completes its execution

    regards,
    bharani
    Rate the posts which you find useful

  8. #8
    Join Date
    Dec 2002
    Posts
    305

    Re: Regarding Process execution

    Try this:

    dim process as new Process
    process.StartInfo.FileName ="prc.bat"
    process.start
    process.WaitForExit()
    Thread.Sleep(1000)
    msgbox("hello")

  9. #9
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Re: Regarding Process execution

    Hi
    I did like this
    Code:
    waitdlg.show()
    dim process as new process
    process.StartInfo.FileName="prc.bat"
    process.start
    process.WaitForExit()
    waitdlg.hide()
    I expect a dialog to appear saying "please wait" as its label. Once the process ends, the dialog should disappear. I do get the dialog. But the dialog is not completely painted. I get a partial one. How can I solve this problem?
    Regards,
    Bharani..

  10. #10
    Join Date
    Dec 2002
    Posts
    305

    Re: Regarding Process execution

    Create a form with the same message as in dialog box. Show it and through form.visible = true and make it disappear with form.visible = false command instead of the dialog.wait - this is an alternative.

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

Featured