473,324 Members | 2,248 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,324 software developers and data experts.

VB6 kill a process?

Hello I started learning vb2005 (didn't learn that much) but I finally got vb6 in the mail soo I was wondering if someone could give me a standard exe example on how to kill a process from the process list. For example it would kill program.exe (when you click the butten) In this format.

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()

End Sub


I tried looking around at examples but it seems they require 5 million lines of code when in express you can do it with 1 command. Thanks for the help!
Jul 6 '07 #1
6 14780
Dököll
2,364 Expert 2GB
Hello I started learning vb2005 (didn't learn that much) but I finally got vb6 in the mail soo I was wondering if someone could give me a standard exe example on how to kill a process from the process list. For example it would kill program.exe (when you click the butten) In this format.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.  
  3. End Sub
  4.  
  5. Private Sub Form_Load()
  6.  
  7. End Sub
  8.  
I tried looking around at examples but it seems they require 5 million lines of code when in express you can do it with 1 command. Thanks for the help!
I believe it's:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. Kill “C:/thisprogram.exe” 
  3. End Sub
  4.  
  5. Private Sub Form_Load()
  6. Kill “C:/thatprogram.exe” 
  7. End Sub
  8.  
thatprogram being the program name you need gone...

I would be careful with Kill though, I am not sure how you'd get things back:-)
Jul 6 '07 #2
pureenhanoi
175 100+
I believe it's:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2. Kill “C:/thisprogram.exe” 
  3. End Sub
  4.  
  5. Private Sub Form_Load()
  6. Kill “C:/thatprogram.exe” 
  7. End Sub
  8.  
thatprogram being the porogram name you need gone...

I would be careful with Kill though, I am not sure how you'd get things back:-)
kill command will delete file from disk only. It cannot kill a running process. i've never kill a process before, but i know that kill command cant do that.
Jul 7 '07 #3
Dököll
2,364 Expert 2GB
kill command will delete file from disk only. It cannot kill a running process. i've never kill a process before, but i know that kill command cant do that.
I should have truly read this, thanks!
Jul 7 '07 #4
Yeah that's what i'm trying to figure out I don't have the command with me but there is a simple command for vb 2005 so I figure there must be one for vb6? Thanks
Jul 7 '07 #5
Robbie
180 100+
I figure there must be one for vb6? Thanks
You figured wrongley. =P

Take a look at this post I made on a different thread.
http://www.thescripts.com/forum/thread673985.html
What I posted also can kill processes - I think it bases it on a Process ID rather than program name, but you can probably cycle through them all until you find one with the name of the process you want to kill.
It's kinda complex though, and I don't understand it, so don't ask me what anything means. x_x
Jul 7 '07 #6
thats to put it in an api/dll i just want it right in the exe code. I know it's possible they told me the same thing for 2005 it took me like a month before i found it it was so simple lol.
Jul 8 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Bob Swerdlow | last post by:
My application starts up a number of processes for various purposes using: self.popen = popen2.Popen3("/usr/local/bin/python -O "myscript.py") and then shuts them down when appropriate with...
10
by: Fred | last post by:
There is a setting in INIT.ORA that has the unintended side-effect of making sure the ALTER SYSTEM KILL SESSION command has immediate affect. Without this setting, I've seen some instances where...
10
by: Jako Menkveld | last post by:
I'm building a relatively simple client-server app. One of the functions of the client is to notify the server when it terminates, this all works fine. The problem comes in when the server is...
3
by: pattanawadee | last post by:
Deall All, Could anybody suggestion me How to kill all inherrit processes (sibling child,previous and parent process) in the case I know only child process id and user id, For example I strart...
6
by: Matthew Wieder | last post by:
What permissions must a user have to be able to succesffuly execute a Process.Kill? I can run it with Admin privleges but not with regular user priveleges - I get an "Access is Denied." The...
0
by: WATYF | last post by:
This is my problem... I have some code that starts a Process and returns it to a variable... (prcBat) At any time while that process is running... I want to be able to Kill it by pressing a...
5
by: Dino Buljubasic | last post by:
My application can allow a user to open a file for viewing by fetching file data from database, creating the file in a temp directory and starting appropriate process (i.e. Adobe or any other...
3
by: elrondrules | last post by:
Hi Am new to python and need your help!! this is my code snip. within my python script I have the following commands.. <snip> import os
4
by: Richard Rossel | last post by:
Hi Fellows, I have a problem with process termination. I have a python code that apache runs through a django interface. The code is very simple, first, it creates a process with the...
2
by: =?Utf-8?B?WVhR?= | last post by:
Hello, In the parent process(A), run update function, and start the update process(B), in B process, kill A, then download and update files, then restart A. I want to know can the B process kill...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.