Ref: 03050016
Title: How to NET RUN OS/2 Batch Files
Date:  12/13/90

Copyright 3Com Corporation, 1991.  All rights reserved.

The 3+Open NET RUN command syntax allows OS/2 commands to be sent from
OS/2 and DOS enhanced workstations to a server, to be executed there using
the server's own processor and memory.

Note:  The ONLY files capable of being executed directly using NET RUN are
OS/2 executable (.EXE) files.  OS/2 batch (.CMD) files cannot be executed
using NET RUN, nor can DOS .COM or .BAT files be run in the OS/2 environment
of the server.

However, OS/2 .CMD type batch files can be executed indirectly using
NET RUN, if it is the OS/2 command processor CMD.EXE that is executed
using NET RUN, and if the name of the .CMD file to be interpreted is passed
to CMD as a command following the /C switch.  The proper syntax for this is
as follows:

    NET RUN CMD /C batch-file-name [parameters...]

For example, to execute an OS/2 batch file named JUNK.CMD on a server using
NET RUN, type the following command line:

    NET RUN CMD /C JUNK


In order for NET RUN commands to work properly, make sure that:

    *  the server is running the NETRUN service

    *  when NET RUN is executed, the current directory is a network
       drive linked to the server which will execute NET RUN

    *  the RUNPATH list of directories used by NET RUN to locate
       executable files includes the directory where CMD.EXE is to
       be found (usually C:\OS2), and RUNPATH also lists the directory
       where the .CMD batch file to be interpreted by CMD is located

The directories in RUNPATH are separated by semicolons (;), just as
in the normal DOS and OS/2 PATH environment variable.  The default
RUNPATH is defined by the "runpath" parameter in LANMAN.INI, but
can be overridden during startup of the NETRUN service by including
the "/RUNPATH:path;path..." switch.  The proper syntax is as follows:

    NET ADMIN \\server-name /C NET START NETRUN /RUNPATH:path;path...

For example, to start up the NETRUN service on server \\JOE and set
RUNPATH to point to directories C:\OS2 and C:\APPS\OS2APPS, type this
command:

    NET ADMIN \\JOE /C NET START NETRUN /RUNPATH:C:\OS2;C:\APPS\OS2APPS

If the NETRUN service was not started up with the right RUNPATH, or the
default for "runpath" in LANMAN.INI is not what is desired, you may stop
the NETRUN service and then restart it, as follows:

    NET ADMIN \\server-name /C NET STOP NETRUN
    NET ADMIN \\server-name /C NET START NETRUN /RUNPATH:path...

