Site icon WinCert

Run a scheduled task via command line


After I had permission issues with running a simple batch job on the server even with local administrator permissions and UAC turned off, I had to find another way for running a batch job remotely.

The solution was to use Scheduled Tasks, since it has the option to run the task under highest privileges.

Since this is a backup job, we need to run a scheduled task remotely by running a scheduled task from the batch file, because of the permission issues. sounds confusing, right?

To be able to run the scheduled task from a .bat file we will use ‘schtasks‘ command, in this case on Windows Server 2008 R2 machine.

If our scheduled task job name is BackupTask and machine name is SPAN here’s how the command should look:

schtasks /run /s \\ServerName /TN “TaskName”

or in our case

schtasks /run /s \\Span /TN Backuptask

Exit mobile version