Schtasks & Commands w/ Parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using NTBackup in combination with schtasks requires one to pass in
parameters as part of the NTBackup command line. How do you get the /TR
switch to accept all the parameters required to run something like NTBackup?

Shortened example:

/TR "ntbackup backup ""@C:\temp\files.bks"" /J ""TEST JOB"""

I've tried all sorts of combinations, but I can't get the quotes right for
the schtasks to see all the ntbackup parameters as a single command line.
Using the example above, schtasks thinks /J is a schtasks parameter which
it's not.
 
Jay said:
Using NTBackup in combination with schtasks requires one to pass in
parameters as part of the NTBackup command line. How do you get the /TR
switch to accept all the parameters required to run something like NTBackup?

Shortened example:

/TR "ntbackup backup ""@C:\temp\files.bks"" /J ""TEST JOB"""

I've tried all sorts of combinations, but I can't get the quotes right for
the schtasks to see all the ntbackup parameters as a single command line.
Using the example above, schtasks thinks /J is a schtasks parameter which
it's not.

AFAIK, it's not possible to embed quotation marks in a command line
argument passed to Schtasks.exe (IIRC, Jt.exe has the same problem). One
possible solution is to put the required information in a shell script
and schedule the shell script.
 
Back
Top