How to terminate process started using the Shell function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Bradley

    #1

    How to terminate process started using the Shell function

    I've looked high and low, but I can't seem to find an answer. When I open an
    application using the shell command, as seen below, how can I close the
    application? I am creating a menu system for powerpoint presentations and
    they all loop. I need to stop one presentation before I staer another. I
    considered using New Process to start the application, but I don't seem to
    be able to pass command line arguments.

    ProcID = Shell("""C:\Pro gram Files\Microsoft Office\PowerPoi nt
    Viewer\PPTVIEW. EXE"" /s c:\testfiles\te st.ppt", AppWinStyle.Nor malNoFocus)

    Any help would be appreciated,

    John


  • Patrick Steele

    #2
    Re: How to terminate process started using the Shell function

    In article <#LqRTjR6HHA.11 84@TK2MSFTNGP04 .phx.gbl>,
    microsoft@jabte ch.com says...
    I've looked high and low, but I can't seem to find an answer. When I open an
    application using the shell command, as seen below, how can I close the
    application? I am creating a menu system for powerpoint presentations and
    they all loop. I need to stop one presentation before I staer another. I
    considered using New Process to start the application, but I don't seem to
    be able to pass command line arguments.
    >
    ProcID = Shell("""C:\Pro gram Files\Microsoft Office\PowerPoi nt
    Viewer\PPTVIEW. EXE"" /s c:\testfiles\te st.ppt", AppWinStyle.Nor malNoFocus)
    Dim pr as Process = Process.GetProc essByID(ProcID)
    pr.Kill() ' or pr.CloseMainWin dow()

    --
    Patrick Steele (patrick@mvps.o rg)

    Comment

    • John Bradley

      #3
      Re: How to terminate process started using the Shell function

      Thanks, worked like a charm.

      John

      "Patrick Steele" <patrick@mvps.o rgwrote in message
      news:MPG.213d57 ca8f63517f98969 5@msnews.micros oft.com...
      In article <#LqRTjR6HHA.11 84@TK2MSFTNGP04 .phx.gbl>,
      microsoft@jabte ch.com says...
      >I've looked high and low, but I can't seem to find an answer. When I open
      >an
      >application using the shell command, as seen below, how can I close the
      >application? I am creating a menu system for powerpoint presentations and
      >they all loop. I need to stop one presentation before I staer another. I
      >considered using New Process to start the application, but I don't seem
      >to
      >be able to pass command line arguments.
      >>
      >ProcID = Shell("""C:\Pro gram Files\Microsoft Office\PowerPoi nt
      >Viewer\PPTVIEW .EXE"" /s c:\testfiles\te st.ppt",
      >AppWinStyle.No rmalNoFocus)
      >
      Dim pr as Process = Process.GetProc essByID(ProcID)
      pr.Kill() ' or pr.CloseMainWin dow()
      >
      --
      Patrick Steele (patrick@mvps.o rg)
      http://weblogs.asp.net/psteele

      Comment

      Working...