VS2008 VB.NET - Problem with System.Diagnostics.Process.Start

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KodeKrazy
    New Member
    • Mar 2008
    • 32

    VS2008 VB.NET - Problem with System.Diagnostics.Process.Start

    I can use System.Diagnost ics.Process.Sta rt to launch .txt, .bmp, .jpg, etc., but if I try to launch an .exe, from the same folder, I get the "The system cannot find the file specified." error.

    For example:
    This works: System.Diagnost ics.Process.Sta rt("C:\swr\test .txt")

    This does NOT: System.Diagnost ics.Process.Sta rt("C:\swr\engi ne.exe")

    Any help is greatly appreciated!

    KK
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Try to use SHELL function .

    Comment

    • joedeene
      Contributor
      • Jul 2008
      • 579

      #3
      Originally posted by KodeKrazy
      I can use System.Diagnost ics.Process.Sta rt to launch .txt, .bmp, .jpg, etc., but if I try to launch an .exe, from the same folder, I get the "The system cannot find the file specified." error.

      For example:
      This works: System.Diagnost ics.Process.Sta rt("C:\swr\test .txt")

      This does NOT: System.Diagnost ics.Process.Sta rt("C:\swr\engi ne.exe")

      Any help is greatly appreciated!

      KK
      Is that the exact file name, directory, and extension of the file? Because basically it looks like it doesn't find it, but if it's having a problem just with the .exe then use the ProcessStartInf o Class and set the .UseShellExecut e property to true.

      joedeene

      Comment

      • KodeKrazy
        New Member
        • Mar 2008
        • 32

        #4
        RESOLVED! Many Thanks!

        Comment

        Working...