Windows IoT
Windows IoT Scheduled Task not running
I am trying to create a scheduled task for Windows IoT on Raspberry Pi to run on boot to check the time on an real time clock hat and then set the system time accordingly. For context, see: https://www.codeproject.com/Articles/1113626/Adding-the-Missing-Real-Time-Clock-to-Windows-IoT. I have a PS script that runs the following: $CurrentDate = ( c:\shares\boot\SetTimeTool.exe ) |Out-String set-date $CurrentDate If I run `c:\shares\boot\UpdateTime.ps1` the time is updated as desired. I then created a scheduled task: schtasks /create /tn "Update Time Script" /tr C:\shares\boot\UpdateTime.ps1 /sc onstart /ru SYSTEM If I set the time to an incorrect value and reboot, the time is not changed after booted up. Also, If I try to run the sheduled task on demand: schtasks /run /tn "Update Time Script" I get the following response, but the time is not updated: SUCCESS: Attempted to run the scheduled task "Update Time Script". Any help is appreciated!
hello Task scheduler is running from Command line and not able to handle PowerShell Scripts you need to add a Command line script which should be executed from Task scheduler the Command line script then executes PowerShell and your script br Andre
hello Task scheduler is running from Command line and not able to handle PowerShell Scripts you need to add a Command line script which should be executed from Task scheduler the Command line script then executes PowerShell and your script br Andre
Thanks, however when I try to run the powershell script via the command line, I get the following error: The system cannot execute the specified program. I am able to run it via powershell. Thanks, Tim
I've found my error, the bat file should be: Powershell.exe -Command "C:\shares\boot\UpdateTime.ps1"
I keep getting "ERROR: Access is denied." when I try to create my startup task in command line. Any ideas why it's doing this?Connor
I keep getting "ERROR: Access is denied." when I try to create my startup task in command line. Any ideas why it's doing this? Connor are you logged in through ssh ?
I keep getting "ERROR: Access is denied." when I try to create my startup task in command line. Any ideas why it's doing this? Connor are you logged in through ssh ? No, that was my problem, actually. I was trying to run the commands from the command line on the Raspberry Pi in the IoT Core Default App. I had to switch to using SSH from my computer and then it worked. I guess Windows IoT must not have admin rights by default, which is why I was getting the error.Connor
Related Links
Microsoft.Maker.Serial missing in git hub clone and on git hub itself
C++ DLL for Windows IoT?
Uninstalling apps
Win 10 IoT Apps
Heap size keep growing
The code below works great if the "CoverLid_ValueChanged" signal came from an actual physical Push-button
Windows IoT Core Headed App or Browser App for basic data entry
Windows 10 IoT Skype
Anyone using BME280?
Webinterface for App
Rebuild image for downloading to flash card
First time setup: Cannot remote in to Raspberry Pi 3 box. Using Powershell (Admin)
UWP support for AMQP?
Dial-up over COM port support?
Windows 10 IoT Core API Porting Tool
Windows 10 IoT Core Installation Not Detecting eMMC