Using the AT Command Correctly in an OS/2 Command File (63969)



The information in this article applies to:

  • Microsoft LAN Manager 2.0
  • Microsoft LAN Manager 2.1
  • Microsoft LAN Manager 2.1a
  • Microsoft LAN Manager 2.2

This article was previously published under Q63969

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.

Modification Type:MajorLast Reviewed:9/30/2003
Keywords:KB63969