I would like to close an .NET CF 3.5 application running on the Toradex Module remotely from my PC. I tried using taskkill, but I just get an error “RPC Service isn’t available”. What would be the correct way to kill an application running on an WEC device.
In the Powertoys installation folder, you will find a folder RAPI_Start, which contains a tool rapistart.exe
With rapistart you can remote start any random application. To kill your application, enter the following command on your PC:
rapistart \Flashdisk\niraj_kill.exe
I don’t know your reasoning for wanting to remotely kill this application. Maybe a general remote access to your device would be preferable? There’s the Remote Display feature, which allows you to see the full desktop of the target device and interact with it using the PC mouse and keyboard.
This option is not limited to ActiveSync, but there is only an Ethernet version available.
Unfortunately, we only have an Ethernet connection to the device. The reason behind having to close the application from a PC is remote deployment of new software versions. We can remote in to a PC which is connected to the WinCE device.
I have used the Remote Display feature, and it works great. However, when our application is running on the device, it takes the foreground, hiding the WinCE taskbar, so can’t access anything but our application. The challenge will be to close without access to OS keys/buttons.
It would have been more helpful if it was possible to invoke the batch file to kill the process over Ethernet.
Write a local application which can kill your main application.
To keep the same example as in my first answer, let’s still call this application niraj_kill.exe
How to start the application niraj_kill.exe
If I got you right part 1 is not an issue, so let’s focus on part 2. There are multiple options:
If you have access to a USB port or SD card socket, and didn’t disable the AutoRun feature, you can simply create a folder \AutoRun on a USB drive or SD card, and copy niraj_kill.exe into this folder.
When you connect this storage to your device, niraj_kill.exe will be automatically executed.
You can activate Telnet on your device. Please refer to the following article for details:
Once you have configured it, you can remotely login into your device and start niraj_kill.exe from the command line.
These two solutions are simple to setup, but open security holes in your device - any application can be executed this way. However, it can be done better:
You can write two simple applications on your PC and on the Colibri, which communicate to each other over Ethernet. Here’s an example how to do this:
The Colibri side can then execute niraj_kill.exe once it was told so by the PC side of your application.
With this approach you can define your own simple protocol, and your Colibri side of the application defines which commands can be executed at all - possibly only niraj_kill.exe.