Search code examples
azure-iot-hubwindows-10-iot-coreazure-iot-hub-device-management

Starting an exe as a service on Windows IoT Core


I'm testing the iot-core-azure-dm-client. I've developed a sample UWP application and incorporated the dm client library code to it. I've deployed the uwp app to the pi (Running on Windows IoT Core), added the SystemConfigurator.exe to the system32 folder and started the service, as stated here.

I managed to get the remote device management working with the Device Controller Application provided in the codebase.

My question is, every time I start the pi, I have to manually run the service SystemConfigurator.exe for the remote device management to work. Is there a way to configure this service to run at startup?


Solution

  • You can create a task to run a batch file when system startup by using following command.

    schtasks /Create /SC ONSTART /TN startSystemConfigurator /TR "c:\Projects\MyApp\Startup.bat" /RU SYSTEM
    

    and the batch file contains the command to start the service net start SystemConfigurator.