Home > Net >  Can you create tasks in the Windows Task Scheduler from a react native desktop app (or any other js
Can you create tasks in the Windows Task Scheduler from a react native desktop app (or any other js

Time:08-13

I am trying to find a way to create a desktop application where I can setup Tasks to run that will turn on my pc and run a c# app / shell script that will send an api request with a video file and a text file.

CodePudding user response:

If you use nodejs, you can execute commands in the terminal with the exec function from the child_process module, then use the schtasks command to schedule tasks.

Commands with nodejs: https://stackabuse.com/executing-shell-commands-with-node-js/

schtasks command: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks

CodePudding user response:

I am unsure about turn on PC part.

You could write a Windows Service worker that runs in the backend, then interact with it vai a local datasource (like a Database or Text file) from your react native desktop app.

In the .Net world you could also host a HangFire web site or something like it. To expose API endpoints for your application to fire off jobs or series of jobs. https://www.hangfire.io/

Or: You should be able to call a PowerShell script. *** Addison Schmidt answer it likely much more direct. Depending on your needs.

  • Related