micropathic Posted December 29, 2003 Posted December 29, 2003 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! Quote
NotesSensei Posted December 30, 2003 Posted December 30, 2003 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 Quote
micropathic Posted December 30, 2003 Author Posted December 30, 2003 That sounds like a good idea. I was not aware you could do that in .net. Thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.