Include task in Windows task scheduler via batch

Asked

Viewed 3,041 times

5

I do the configuration of several types of backups per batch, the codes are not pertinent to this question, but what it takes is always configure them by the Windows Task Scheduler.

There are some ways to add these tasks by batch?

I wish I could set it up in batch:

  • Task name;
  • Different times of implementation;
  • Whether it is monthly or daily;
  • Run only when the user is logged in or not.

Besides being able to add this task, it would be interesting to know if she exists first, because in that case could make such a check in the first run backup manually for example.

2 answers

1

You can use the command at.

at \\"nomedopc" 00:00 /interactive /every:m,t,w,th,f,s,su "\\nomedoarquivo.bat"

Don’t forget to authenticate on the station with any user belonging to the group Domain admin, or another user that is administrator local.

By running the above command, it creates a scheduled task to run at 00:00 every day.

  • He gave this message: The AT command was passed over. Use schtasks.exe instead.

0

Hello, below is a sample command. You can/should also type in the console:

schtasks /create /?
schtasks /change /?
schtasks /?

Example:

schtasks.exe /Create /ST 12:10 /SC DAILY /TN Sistema_BackupERP /TR "C:\SISTEMA\BancoDeDados\appBackup\BackupBaseDeDados" /RL HIGHEST /F /RU "NT AUTHORITY\SYSTEM"

I have this most advanced question open:

TASK SCHEDULER VIA COMMAND PROMPT

Browser other questions tagged

You are not signed in. Login or sign up in order to post.