Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

AT command in DOS help please

Posted on 2003-02-25
5
Medium Priority
?
247 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
  • 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

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

564 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