How to terminate process started using the Shell function

  • Thread starter Thread starter John Bradley
  • Start date Start date
J

John Bradley

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:\Program Files\Microsoft Office\PowerPoint
Viewer\PPTVIEW.EXE"" /s c:\testfiles\test.ppt", AppWinStyle.NormalNoFocus)

Any help would be appreciated,

John
 
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:\Program Files\Microsoft Office\PowerPoint
Viewer\PPTVIEW.EXE"" /s c:\testfiles\test.ppt", AppWinStyle.NormalNoFocus)

Dim pr as Process = Process.GetProcessByID(ProcID)
pr.Kill() ' or pr.CloseMainWindow()
 
Back
Top