Windows – Creating scheduled tasks from command line (using parameters)

batchcommand linewindows

I am trying to create a scheduled task from command line, although I can create in fine when defining the executable, I have problems when trying to add a parameter for that executable:

schtasks /Create /SC DAILY /TN TestRun /TR "C:\Program Files\Test\test.exe" C:\

I am effectively trying to launch "test.exe C:\"

Best Answer

schtasks /Create /SC DAILY /TN TestRun /TR "'C:\Program Files\Test\test.exe' 'C:\'"

You can read details in help:

schtasks /Create /? 
Related Question