Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

If my vb .net app is running and I want to kill the process by sending a command to it, how can I do that? For instance if I can start the program w/ a switch like: myapp.exe /start is there a way to kill the app by sending a switch to it?

 

Basically what I'm trying to do his have my program run automatically when a user connects their Win CE device to the PC. That part I have figured out because the computer automatically detects when the device has been connected and it runs a registry key (auto_start_on_connect), so, when I enter the command line "myapp.exe /start" in that registry key, it fires that command. There is a similar registry key that fires as soon as the phone is disconnected called "auto_start_on_disconnect", but if I enter something like "myapp.exe /killit", it starts a whole other instance of my app and only passes the command to that instance.

 

How can I make it so the appliction instance already runnning receives a command to kill itself, without starting another instance of the app?

 

Thanks in advance for any help!

Posted

Hi Micropahic,

Why not write your vb.net application as a windows service (if your'e not targeting Win98)? Then you can do a NET START and a NET STOP to start/stop it. .NET also allows you to start/stop services.

Hope that help

:-) stw

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...