How to terminate process started using the Shell function

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
 
P

Patrick Steele

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()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top