Напиши java script под Windows который запускает мою команду каждый час, работает в фоне и запускается при старте системы.
const { exec } = require("child_process");
// Array of commands to run every hour
const commands = [
"dir C:\\",
"npm update",
// Add more commands here
];
setInterval(() => {
// Loop through each command
commands.forEach(command => {
// Execute the command in the shell
exec(command, (error, stdout, stderr) => {
if (error) {
console.error(`Error executing ${command}`, error);
return;
}
console.log(`Ran ${command} successfully`);
console.log(stdout);
});
});
}, 3600000); // Repeat every hour (3600000 milliseconds)
console.log("Started running hourly commands");