Process.Start

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lakepeir@yahoo.com

    #1

    Process.Start

    Hello,

    I'm trying to launch a text file in the Notepad application. When I
    click the menu item, the application is not launched and the text file
    is not launched. Listed below is the code.

    Code:

    Private Sub MenuItem_Help_C lick(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles MenuItem_Help.C lick
    'Process.Start( "Notepad.ex e", "Help.txt")
    End Sub

  • Herfried K. Wagner [MVP]

    #2
    Re: Process.Start

    <lakepeir@yahoo .comschrieb:
    I'm trying to launch a text file in the Notepad application. When I
    click the menu item, the application is not launched and the text file
    is not launched. Listed below is the code.
    >
    Code:
    >
    Private Sub MenuItem_Help_C lick(ByVal sender As Object, ByVal e As
    System.EventArg s) Handles MenuItem_Help.C lick
    'Process.Start( "Notepad.ex e", "Help.txt")
    End Sub
    The line is commented out. Remove the "'" character in front of it.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • lakepeir@yahoo.com

      #3
      Re: Process.Start

      Oops. Sorry. I have modified the code by adding some additional
      implementation and commenting that line out. The actual code is not
      commented out. It still doesn't launch the application.
      Thanks.
      Herfried K. Wagner [MVP] wrote:
      <lakepeir@yahoo .comschrieb:
      I'm trying to launch a text file in the Notepad application. When I
      click the menu item, the application is not launched and the text file
      is not launched. Listed below is the code.

      Code:

      Private Sub MenuItem_Help_C lick(ByVal sender As Object, ByVal e As
      System.EventArg s) Handles MenuItem_Help.C lick
      'Process.Start( "Notepad.ex e", "Help.txt")
      End Sub
      >
      The line is commented out. Remove the "'" character in front of it.
      >
      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      • Bruce W. Darby

        #4
        Re: Process.Start

        Lakepier,

        This may sound a bit simplistic, but is the path to the Help.txt file on the
        local machine? Or is it on a network?

        Bruce

        <lakepeir@yahoo .comwrote in message
        news:1167533321 .779242.278970@ n51g2000cwc.goo glegroups.com.. .
        Oops. Sorry. I have modified the code by adding some additional
        implementation and commenting that line out. The actual code is not
        commented out. It still doesn't launch the application.
        Thanks.
        Herfried K. Wagner [MVP] wrote:
        ><lakepeir@yaho o.comschrieb:
        I'm trying to launch a text file in the Notepad application. When I
        click the menu item, the application is not launched and the text file
        is not launched. Listed below is the code.
        >
        Code:
        >
        Private Sub MenuItem_Help_C lick(ByVal sender As Object, ByVal e As
        System.EventArg s) Handles MenuItem_Help.C lick
        'Process.Start( "Notepad.ex e", "Help.txt")
        End Sub
        >>
        >The line is commented out. Remove the "'" character in front of it.
        >>
        >--
        > M S Herfried K. Wagner
        >M V P <URL:http://dotnet.mvps.org/>
        > V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
        >

        Comment

        • Tom Leylan

          #5
          Re: Process.Start

          Seriously this is only one line of code what could be programmed wrong?
          It's not ASP code right?

          Here is what you do to debug these things.

          1) trace it with the debugger and make certain the event fires and that line
          executes.
          2) spell notepad.exe as "errorpad.e xe" and see if it fails.
          3) substitute any other app you have installed for notepad and see if it
          works.
          4) open a new project, add a new form, add a new button and put the notepad
          code in that one.

          Let us know what happened.

          <lakepeir@yahoo .comwrote in message
          news:1167533321 .779242.278970@ n51g2000cwc.goo glegroups.com.. .
          Oops. Sorry. I have modified the code by adding some additional
          implementation and commenting that line out. The actual code is not
          commented out. It still doesn't launch the application.
          Thanks.
          Herfried K. Wagner [MVP] wrote:
          ><lakepeir@yaho o.comschrieb:
          I'm trying to launch a text file in the Notepad application. When I
          click the menu item, the application is not launched and the text file
          is not launched. Listed below is the code.
          >
          Code:
          >
          Private Sub MenuItem_Help_C lick(ByVal sender As Object, ByVal e As
          System.EventArg s) Handles MenuItem_Help.C lick
          'Process.Start( "Notepad.ex e", "Help.txt")
          End Sub
          >>
          >The line is commented out. Remove the "'" character in front of it.
          >>
          >--
          > M S Herfried K. Wagner
          >M V P <URL:http://dotnet.mvps.org/>
          > V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
          >

          Comment

          • lakepeir@yahoo.com

            #6
            Re: Process.Start

            It's on a local machine.
            Bruce W. Darby wrote:
            Lakepier,
            >
            This may sound a bit simplistic, but is the path to the Help.txt file on the
            local machine? Or is it on a network?
            >
            Bruce
            >
            <lakepeir@yahoo .comwrote in message
            news:1167533321 .779242.278970@ n51g2000cwc.goo glegroups.com.. .
            Oops. Sorry. I have modified the code by adding some additional
            implementation and commenting that line out. The actual code is not
            commented out. It still doesn't launch the application.
            Thanks.
            Herfried K. Wagner [MVP] wrote:
            <lakepeir@yahoo .comschrieb:
            I'm trying to launch a text file in the Notepad application. When I
            click the menu item, the application is not launched and the text file
            is not launched. Listed below is the code.

            Code:

            Private Sub MenuItem_Help_C lick(ByVal sender As Object, ByVal e As
            System.EventArg s) Handles MenuItem_Help.C lick
            'Process.Start( "Notepad.ex e", "Help.txt")
            End Sub
            >
            The line is commented out. Remove the "'" character in front of it.
            >
            --
            M S Herfried K. Wagner
            M V P <URL:http://dotnet.mvps.org/>
            V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

            Comment

            • lakepeir@yahoo.com

              #7
              Re: Process.Start

              Thank you! It works. I put a breakpoint in the method and it never
              executed. The code was in the incorrect method.
              Tom Leylan wrote:
              Seriously this is only one line of code what could be programmed wrong?
              It's not ASP code right?
              >
              Here is what you do to debug these things.
              >
              1) trace it with the debugger and make certain the event fires and that line
              executes.
              2) spell notepad.exe as "errorpad.e xe" and see if it fails.
              3) substitute any other app you have installed for notepad and see if it
              works.
              4) open a new project, add a new form, add a new button and put the notepad
              code in that one.
              >
              Let us know what happened.
              >
              <lakepeir@yahoo .comwrote in message
              news:1167533321 .779242.278970@ n51g2000cwc.goo glegroups.com.. .
              Oops. Sorry. I have modified the code by adding some additional
              implementation and commenting that line out. The actual code is not
              commented out. It still doesn't launch the application.
              Thanks.
              Herfried K. Wagner [MVP] wrote:
              <lakepeir@yahoo .comschrieb:
              I'm trying to launch a text file in the Notepad application. When I
              click the menu item, the application is not launched and the text file
              is not launched. Listed below is the code.

              Code:

              Private Sub MenuItem_Help_C lick(ByVal sender As Object, ByVal e As
              System.EventArg s) Handles MenuItem_Help.C lick
              'Process.Start( "Notepad.ex e", "Help.txt")
              End Sub
              >
              The line is commented out. Remove the "'" character in front of it.
              >
              --
              M S Herfried K. Wagner
              M V P <URL:http://dotnet.mvps.org/>
              V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

              Comment

              Working...