473,407 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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

Any help would be appreciated,

John
Aug 28 '07 #1
2 10739
In article <#L**************@TK2MSFTNGP04.phx.gbl>,
mi*******@jabtech.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:\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()

--
Patrick Steele (pa*****@mvps.org)
http://weblogs.asp.net/psteele
Aug 28 '07 #2
Thanks, worked like a charm.

John

"Patrick Steele" <pa*****@mvps.orgwrote in message
news:MP************************@msnews.microsoft.c om...
In article <#L**************@TK2MSFTNGP04.phx.gbl>,
mi*******@jabtech.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:\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()

--
Patrick Steele (pa*****@mvps.org)
http://weblogs.asp.net/psteele

Aug 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Blue in Green | last post by:
Hi, How can I check whether a program, started with the 'shell' function, has terminated? Can this be done with value, returned from the shell function? Thx Marc
2
by: MrKrich | last post by:
I use shell function to call winzip to unzip file. My problem is I want it to show error if it get error such as the file that it try to open is not .zip. This is my code : procID =...
3
by: Mr Utkal Ranjan | last post by:
Hi Friends I want to launch notepad with a specific file on a command click event. So I was using the "Shell" function from VB on a command click event.For ex: Shell "Notepad.exe C:\Program...
2
by: micahstrasser | last post by:
I have been trying for days to send a command to the command prompt through the shell() function in vb.net. For some reason it is not working. Here is the code: Private Sub Button1_Click(ByVal...
9
by: dave m | last post by:
I have a small application that launches an application via the shell function when a listening socket receives data from another PC. This works fine using a WinForms environment. However, I...
4
lwwhite
by: lwwhite | last post by:
I'm working with VB in an Access 2003 database. I have a form, called "EditWindowsFields," that contains a field called "sourcedoc." I am trying to use the Shell function to open the XML file that is...
14
by: JHNielson | last post by:
I posted this in the Access thread, but seeing as how this is a VB problem, I thought this might be the better place I have a code to FTP files to a server, using a script FTP.scr. I need to...
0
by: kowndinya | last post by:
hai When i call an external program using shell function, it is running succesfully what i need to do from the external program except the return value is zero hence i can't close that program. if ...
3
by: ppuniversal | last post by:
Hi everyone, I am making using Shell() function to run a command line tool from my VB Application. I am using it to archive a folder. So I am using the code : Shell("command line argument as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.