Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remotely stop an app running on a Win 98 workstation.

Status
Not open for further replies.

tedsmith

Programmer
Nov 23, 2000
1,762
AU
I want to close an app running on an external Windows98 unattended workstation by remote control.
This is so I can update the .exe by remote control.

I seem to remember some code some years ago that enumerated the task list but cant find it.
Windows 98 doesn't seem to have a task list like Xp so would it work in 98 anyway?.

I have the worktation visible on VNC remote desktop OK but VNC's CTRL ALT DEL feature doesn't work to Win98 for some reason.

Alternately if I could have a small app on the remote machine that I could start by VNC to sendkeys CTRL ALT DEL, I could stop the app with it's own Close Program dialog box but sendkeys doesn't send ACTL ALT DEL either!

Any ideas?
 
Could this be what you are looking for?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
Many remote control client accept Ctel-Alt-End for this. have you tried it?
 
Thanks
VB6 Yes, I want to make a small app that simply does CTRL ALT DEL when you run it. I can copy this to the workstation and run it there using VNC and this stop the application with the Close Program box(which has it's stop icon hidden)

Alternately make an app the same way that closes the program running in Win98 like you can by enumerating the task list in XP. The program is always the first item in the Close Program dialog box when you press CTRL ALT DEL on a keyboard on the workstation.

No CTRL ALT END only works with Microsoft remote desktop
With VNC it had a button that simulates CTRL ALT DEL but this only works with XP on.
The workstations don't work with MS desktop

Re Webmaster forum
How do I navigate around the site to find the article? It looks a very confusing site.
 
tedsmith said:
Re Webmaster forum
How do I navigate around the site to find the article? It looks a very confusing site.

That's probably because it is the linked >>>>>>> this <<<<< is where you need to be, not the forum in my signature :-D

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
This looked interesting:

Shell.WindowsSecurity method

This method displays the dialog box shown after pressing CTRL+ALT+DELETE or using the security option on the Start menu.

But:

Note This method can be used only when connected by a terminal session to Microsoft Terminal Server.

and:

Minimum supported client Windows XP

I suspect there just isn't a way to do what you want, or else if there is it involves somehow fiddling with the keyboard driver.


Sounds like you either need to go "process spelunking" and try to kill it (Win9x uses a different API for this than NT5+ I think) or add something to your "to be killed" program.

For example you could have it use a Winsock control that it listens on. When it gets a connection request it could accept it if it is from 127.0.0.1 and then await a command like "go away" and then terminate itself.
 
Thanks, the MS link tells me how to list the running processes OK.

Some years ago a routine was posted here that stopped a process after finding its handle with a similar routine (hopefully).
I cant seem to find it now - unfortunately.

If I had this I could send the app to the workstation using the built in FTP in VNC then install and run it using the Windows key in VNC that does work in 98 and it's Windows explorer
 
There is also a related MS KB article that discusses enumerating processes, and it provides a link (still working!) to a downloadble tutorial demo:

SAMPLE: MODLIST.EXE Shows How to Enumerate Processes and Modules

As far as stopping a selected process goes, there isn't a really simple way to do it.

First you need to find out what kind of process it is, a console program uses a different mechanism thatn a GUI program. For a GUI program you'd try to find its topmost window's handle and send a "close" message to it. Only if the process fails to terminate itself after being asked to (you wait a few seconds) would you try to kill it using TerminateProcess().

The problem is that TerminateProcess() is a messy "last resort" that doesn't give the program time to close files, deallocate objects, unload DLLs, and lots of other things.
 
I seem to remember that the first part of the old routine identified the handle of the program that was associated with its application name, then you could close it by its handle so you would be sure of what you were closing.
I am not worried about prematurely closing this app.
It was essentially the same as closing it using the task manager in XP onwards.
 
>I seem to remember that the first part of the old routine identified the handle of the program that was associated with its application name

Here's Hypetia's version of this: thread222-837273
 
>No CTRL ALT END only works with Microsoft remote desktop

Not true; other remote services will also work with this. However, not all do, and your VNC app may be one of them. RealVNC, for example, uses SHIFT CTL ALT DEL

On the other hand:

>VNC's CTRL ALT DEL feature doesn't work to Win98 for some reason

Well, no - VNC does not allow it, because on W98 CAD would cause all applications, including the VNC server, to halt ...
 
Thanks.
What I meant by <VNC's CTRL ALT DEL feature> was the icon at the top of the VNC page that simulated CTRL ALT DEL.

As it would halt the VNC making further usage impossible, with Win98, is there perhaps another way of stopping an app with VNC?
 
Hah, that's an excellent point about C-A-D locking up the remote control service. Just as well there isn't an API call to pop up the "close tasks" dialog either then.

So either build something into the program to watch for some type of "go away" alert (TCP/IP, broadcast custom window message, etc.) or else build some "go spelunking for that process" program that sends it a standard WM_CLOSE or something once found.
 
As you have an interactive session to the Windows 98 box, why not just run taskman.exe?


Take Care

Matt
I have always wished that my computer would be as easy to use as my telephone.
My wish has come true. I no longer know how to use my telephone.
 
My Win98's don't have taskman
Would the XP version run in 98 without doing some damage?
 
>My Win98's don't have taskman

Are you sure? It is normally located in C:\Windows

If you don't have it, and still want to manage this thropugh some sort of process/task mananger rather than adopting one of dilettante's ideas or hypetia's code, then you might be better off installing the Sysinternals Process Explorer rather than trying to use XPs taskmgr. You will need an older version of Process Explorer than currently available from main Sysinternal site. 8.52 was the last version to support Windows 98, I believe:
 
I'm pretty sure Win9x didn't offer a Task Manager. A search ought to turn up any number of 3rd party atempts at such a thing though. No idea about quality or efficacy so I don't have any recommendations.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top