Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Calling an .exe inside VB.NET

Calling an .exe inside VB.NET

Scheduled Pinned Locked Moved Visual Basic
questioncsharphelp
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    baby chai
    wrote on last edited by
    #1

    Hi! I have a program that only runs the way I want it to from cmd line. Such as: > myprogram "c:\mydirectory\file.dll" Now, I want to automate running this program against a lot of dll's so the argument in the cmd line is bound to change. And the other thing is, I need to parse the output of the program dumped to standard out. So essentially, what would be great is if i can call something like: > myprogram "c:\mydirectory\file.dll" > output.txt I have the following code so far --------------------------------------------------- Dim p As New Process() Dim p_info As New ProcessStartInfo() p_info = p_info.RedirectStandardOutput = False p_info.UseShellExecute = True p_info.FileName = "myprogram.exe" p_info.Arguments = "c:\mydirectory\file.dll" p.Start(p_info) --------------------------------------------------- I tried setting UseShellExecute to false and for some reason, myprogram doesn't launch properly. I can't have UseShellExecute and RedirectStandardOutput both true. So how do I accomplish getting this standard out? Thanks for the help!

    B 1 Reply Last reply
    0
    • B baby chai

      Hi! I have a program that only runs the way I want it to from cmd line. Such as: > myprogram "c:\mydirectory\file.dll" Now, I want to automate running this program against a lot of dll's so the argument in the cmd line is bound to change. And the other thing is, I need to parse the output of the program dumped to standard out. So essentially, what would be great is if i can call something like: > myprogram "c:\mydirectory\file.dll" > output.txt I have the following code so far --------------------------------------------------- Dim p As New Process() Dim p_info As New ProcessStartInfo() p_info = p_info.RedirectStandardOutput = False p_info.UseShellExecute = True p_info.FileName = "myprogram.exe" p_info.Arguments = "c:\mydirectory\file.dll" p.Start(p_info) --------------------------------------------------- I tried setting UseShellExecute to false and for some reason, myprogram doesn't launch properly. I can't have UseShellExecute and RedirectStandardOutput both true. So how do I accomplish getting this standard out? Thanks for the help!

      B Offline
      B Offline
      baby chai
      wrote on last edited by
      #2

      never mind i found how it works http://www.devx.com/dotnet/Article/7914/0/page/5

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups