For some reason, one of my machines running Windows XP seemed to die while I was away at a meeting. I could still see all the applications I had left running on the desktop. The physical connections seemed to be fine, but any mouse move or keystroke was ignored. Even Ctrl-Alt-Del didn’t work. I could see the mouse cursor, but it didn’t budge.
It’s on a multiswitch box, which allows me to switch the mouse/keyboard/monitor to any of 3 different machines by a keystroke combination. The switching worked and showed that the mouse/keyboard were working just fine.
I could ping the machine, and it would respond. It’s a web server, and I could hit the web site and it served up web pages as expected.
The UI just seemed totally frozen. I didn’t want to just cycle the power on/off.
So I used the CREATEOBJECTEX( ) Function to create an instance of VFP on that machine and shut it down gracefully. The Kill command from the Windows resource kit sends a message to each app to shutdown. You can also use the TASKKILL command.
ox.DoCmd("!/n kill outlook")
ox.DoCmd("!/n kill mstsc")
ox.DoCmd("!/n kill ps")
ox.DoCmd("!/n kill winword")
ox.DoCmd("!/n shutdown -r")
See also Reboot from remote desktop