schtasks query - schtasks commands

// Enter your action script here
waithidden cmd.exe /C schtasks /create /tn Kill_Notepad2 /tr “taskkill /im notepad.exe” /sc MINUTE

above is task and i need bigfix to create it under scheduletasks and it should run whether the user is logged it or not

how should i use /ru /rp /np options in baove schtasks command ?

You only need to add the /ru parameter like so:

waithidden cmd.exe /C schtasks /create /tn Kill_Notepad2 /tr "taskkill /im notepad.exe" /sc MINUTE /ru system

This will:

  1. run the task under local system
  2. run whether a user is logged on or not

Tried it and also tried /RT hightest

still same error.

Also provided “log on as batch job” to system … but still same error with same exit code

how can we give cmd.exe to run as administrator here ?

What fails? Creating the scheduled task or executing it?

If it creates OK but fails to run, does the created task look exactly as you would expect?

Start at the beginning.

First you need to figure out how to use taskkill.

Then schtasks.

Then BigFix.