0

How is it possible to define the name / ID of a job whilst creating a task with the AT command?

hlovdal
  • 23,353
  • 10
  • 78
  • 148
Mike
  • 285
  • 3
  • 5
  • 7

2 Answers2

1

You can't specify an ID or name at creation with AT.

You can use SCHTASKS /CREATE to create a task and use the /TN switch to specify a task name, however. See here for more information: Schtasks @ MSDN

0

While you can't specify the ID that is used with the AT command, you can use this script to identify the ID that your AT scheduled task is using so you can delete it from a batch file (assuming that is your objective):

Set sCommand=ScheduledCommand.cmd

:LOOP
AT>AT.txt
findstr /I %sCommand% AT.txt>nul
If %ErrorLevel%==1 Goto CONTINUE
FOR /F %%i IN ('findstr /I %sCommand% AT.txt') DO (set ID=%%i)
AT %ID% /D
Goto LOOP

:CONTINUE
DEL AT.txt>nul

Usage: Simply set sCommand to the name of the command that you have scheduled.