0

So I have my application deployed to my Raspberry Pi 3 that is running win10 IoT, and I want to use schtasks to run it at certain times. Where is my application "deployed" to on the device so I can add it to a scheduled task?

Edit: Found the app, but I can't seem to create a scheduled task to run the .winmd file.

This is what I tried:

schtasks /create /tn feedertest /sc minute /ru administrator /rp notrealpwd /mo 5 /tr "c:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\CatFeeders-uwpVS.Debug_ARM.greg\catfeeders.winmd"

2 Answers2

0

WINMD file is not an executable file for running the UWP application, it is a binary file of Windows Runtime Metadata. You need to use IotStartup command to run the UWP application on Windows IoT Core. Please refer to following command:

Update:

#create the task
schtasks /create /tn feedertest /sc minute /ru administrator /rp notrealpwd /mo 1 /tr "IotStartup add headed <your app package family name>"

#run the task
schtasks /Run /TN feedertest

BTW, you can get how to get app package family name from here.

Michael Xu
  • 4,382
  • 1
  • 8
  • 16
  • That got me closer! It still wouldn't run, so I tried from the command line and now I am getting this: `PS C:\Data\Users\Administrator\Documents> IotStartup run CatFeeders-uwp_f3hfmmwf56e24 ERROR: failed to activate CatFeeders-uwp_f3hfmmwf56e24!App (0x80070005)` That code is "access denied", yes I'm connected to it with powershell in administrator mode (no UAC), but test running the scheduled task doesn't work either – greg smythe Feb 09 '18 at 01:44
  • You can try to use the following cmdlet:`iotstartup add headed `. It can active the headed application in powershell. – Michael Xu Feb 09 '18 at 02:17
  • I don't want it to start on startup though, I need to be able to run it through schtasks – greg smythe Feb 09 '18 at 23:23
  • @MichaelXu-MSFT can this be used to run a UWP app as Administrator? – Thomas Feb 16 '18 at 17:16
0

Thank you for the help, but it looks like Windows IoT isn't the right platform for what I'm trying to do. :( I switched Raspbian, wrote about 20 lines of python, and added it to the crontab.