?
Solved

AT command in DOS help please

Posted on 2003-02-25
5
Medium Priority
?
242 Views
Last Modified: 2010-05-18
I am creating a scheduled job on another PC using the dos AT command.
This works OK, but I am trying to manually assign the id number of the scheduled job, is this possible?
The at/? command doesn't give me much help.
eg
at \\pcname 10:00 /interactive "command in here"
this works ok, but i want to give it a job number thus
at \\pcname 1 10:00 /interactive "command in here"

any help would be greatly appreciated.

Ian
0
Comment
Question by:ianduncan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:billious
ID: 8016370
ianduncan,

I believe that the AT is confusing, and that there are two forms to the command, shown on two separate lines

at ... id /delete...

and

at time /interactive ...command...

AT assigns a number serially to commands it has queued.

at ... id /delete deletes a queued command ...

at time ...

queues a new command (and automatically assigns it a serial number, so that the AT ID /DELETE can be used to delete that command individually.)

hence, you cannot assign an ID to a new queued command - it is assigned automatically.

(Based on NT4 - later versions may be different)

...Bill
0
 

Author Comment

by:ianduncan
ID: 8016412
Thanks Bill,
Does anybody know if this is possible to do in Windows 2000?

Ian
0
 
LVL 10

Accepted Solution

by:
pbarrette earned 100 total points
ID: 8018184
Hi Ian,

To my knowledge this is not possible. The AT command is referencing the "Task Scheduler" service which is assigning the ID number based on the ID's currently in use.

It is possible, however to execute an AT command, then store the ID number assigned via a batch file:
:: ----ATID.BAT----
@ECHO OFF
AT \\Computer HH:MM:SS MyProgram >ATID.TXT
FOR /F "TOKENS=2 DELIMS==" %%F IN (ATID.TXT) DO (SET ATID=%%F)
DEL ATID.TXT
SET ATID=%ATID:~1%
ECHO %ATID%
:: ----ATID.BAT----

The reason we are trimming the %ATID% variable near the end is because it contains a leading space. Trimming it with an offset of 1 removes the leading space. Doing it this way should allow the batchfile to work with international versions since we aren't assuming that the AT command returns "Added a new job with job ID = 1" in English. We are only assuming that the AT command returns "Blah, blah, blah = 1" which should hold true for other languages.

pb
0
 

Author Comment

by:ianduncan
ID: 8087833
Thanks again pb
vey usefull code
0
 
LVL 10

Expert Comment

by:pbarrette
ID: 8089003
Hi Ian,

No problem. Glad you've got what you need.
pb
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question