Specify ID of AT command?

L

LillyC

Question:
Is there a way to set the ID via the AT command or use some other method
to create a task with a specific ID?

What I'm doing (trying to do):
I'm adding schedule items via the AT command.

Whenever the user runs my software, I'd like to be able to remove old
items that I added before I add a new one.

Problem:
I can remember the id returned in the status of the AT command, but it
isn't very specific. If the user or some other program removes my
scheduling item and another is put in it's place, then I will end up
destroying the wrong item when I start up again.

Why schtasks doesn't work for me:
I tried using schtasks but this doesn't appear to work on XP Home (I need
to work on 2k,XP Home, Pro, 2003, and hopefully Vista.
I also could not find a way to run schtasks as System (I'm creating the
task from a Java program)


-Lilly
 
S

Steve Parry

LillyC said:
Question:
Is there a way to set the ID via the AT command or use some other method
to create a task with a specific ID?

What I'm doing (trying to do):
I'm adding schedule items via the AT command.

Whenever the user runs my software, I'd like to be able to remove old
items that I added before I add a new one.

Problem:
I can remember the id returned in the status of the AT command, but it
isn't very specific. If the user or some other program removes my
scheduling item and another is put in it's place, then I will end up
destroying the wrong item when I start up again.

Why schtasks doesn't work for me:
I tried using schtasks but this doesn't appear to work on XP Home (I need
to work on 2k,XP Home, Pro, 2003, and hopefully Vista.
I also could not find a way to run schtasks as System (I'm creating the
task from a Java program)


-Lilly

At /? gives

AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername Specifies a remote computer. Commands are scheduled on
the
local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled
command.
/delete Cancels a scheduled command. If id is omitted, all the
scheduled commands on the computer are canceled.
/yes Used with cancel all jobs command when no further
confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the user
who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week or
month. If date is omitted, the current day of the month
is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the
day (for example, next Thursday). If date is omitted,
the
current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.
 
L

LillyC

At /? gives
... snip ...



Wikipedia gives:
...
Google gives:
...

So what?


Why bother attempting a solution if you haven't read the question?

I'm using AT, I know the parameters. Is there something I missed that
answers the nicely formated "Question:" section at the top of my post?

AT's ID parameter only works when deleting a task, not creating one.
 
P

Papa

With your attitude, I'll be surprised if anyone will respond. Steve was just
trying to help. I know the answer. Too bad you don't. :>)
 
J

Jerold Schulman

In-line.

Question:
Is there a way to set the ID via the AT command or use some other method
to create a task with a specific ID?
No.

What I'm doing (trying to do):
I'm adding schedule items via the AT command.

Whenever the user runs my software, I'd like to be able to remove old
items that I added before I add a new one.
Problem:
I can remember the id returned in the status of the AT command, but it
isn't very specific. If the user or some other program removes my
scheduling item and another is put in it's place, then I will end up
destroying the wrong item when I start up again.

Just parse the AT command in a FOR command, testing the "command" and deleting the correct one.
Why schtasks doesn't work for me:
I tried using schtasks but this doesn't appear to work on XP Home (I need
to work on 2k,XP Home, Pro, 2003, and hopefully Vista.
I also could not find a way to run schtasks as System (I'm creating the
task from a Java program)
XP home doesn't support schtasks.
See if tip 5335 » Can I use the Windows XP command line scheduler in Windows 2000?
in the 'Tips & Tricks' at http://www.jsifaq.com will make schtasks from XP Pro run on XP Home.



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
L

LillyC

In-line.




Just parse the AT command in a FOR command, testing the "command" and
deleting the correct one.

XP home doesn't support schtasks.
See if tip 5335 » Can I use the Windows XP command line scheduler in
Windows 2000?
in the 'Tips & Tricks' at http://www.jsifaq.com will make schtasks
from XP Pro run on XP Home.



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com

Thanks for the link Jerold.

Rather than hack the exe, someone pointed out to me that we could just
get the details on the task we want to delete and make sure the command
is ours before deleting it.

- Lilly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top