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

ID: Q63969


The information in this article applies to:
  • Microsoft LAN Manager, versions 2.0, 2.1, 2.1a, 2.2


SUMMARY

The AT command should be used only to run programs that do no screen, keyboard, etc. 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 query words: 2.00 2.10 2.0 2.1 2.1a 2.10a 2.20

Keywords :
Version : :2.0,2.1,2.1a,2.2
Platform :
Issue type :


Last Reviewed: November 5, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.