INF: Using the AT Command Correctly in an OS/2 Command File

ID Number: Q63969

2.00 2.10

OS/2

Summary:

The AT command should be used only to run programs that do no screen,

keyboard, and so on, I/O. When the AT command spawns a process, it

runs detached in the background.

Unfortunately, when that process is spawned, it will not have a path.

Therefore, if anything is run that is not in the \LANMAN\NETPROG

subdirectory, or is an internal OS/2 command (such as COPY), a

complete path must be specified. For example, the following command

can be used:

c:\binp\cp \autoxec.bat \save\autoexec.bat

However, if a PATH statement is inserted in OS2INIT.CMD, this PATH

statement will be valid while the process is running. This works

because OS2INIT.CMD is executed when the new process is spawned.

More Information:

Example

-------

Suppose you have a command file with the following command in it:

AT 10:10 /every:M,T,W,Th,F"c:\cmd\os2save.cmd"

The command file, OS2SAVE.CMD, merely saves files from one

subdirectory into another subdirectory. OS2SAVE.CMD contains the

following lines:

cp \autoexec.bat \save\autoexec.bat

cp \config.sys \save\config.sys

Running the command file without the AT command from the OS/2 prompt

works properly. However, running the command with the AT command does

not work. Changing "cp" to "copy" in OS2SAVE.CMD and using the OS/2

COPY command works properly.

Additional reference words: 2.00 2.10 2.0 2.1