How to Allow OS/2 Programs to Run Across Logons

Last reviewed: December 16, 1996
Article ID: Q137861
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with:

        - Microsoft Windows NT versions 3.51 and 4.00
    

SUMMARY

When you launch an OS/2 application from a service in Windows NT, the OS/2 application terminates when the current user logs off. If you want the application to continue running after the user logs off, you can:

  • Run the OS/2 application from the Windows NT Resource Kit utility called SRVANY.

    -or-

  • Launch Os2.exe directly from the service, and pass the /S switch. The syntax of the call would be:

    CreateProcess (

          NULL,
          "OS2.EXE /S /P <full path to exe> /C <command line>",
          . . .
          );
    

    The <command line> includes the name of the executable. For example:

          CreateProcess (
    
             NULL,
             "OS2.EXE /S /P C:\\OS2BINS\\LS.EXE /C LS *.c",
             . . .
             );
    
    
In either case, you must make sure that the first OS/2 application started after booting your system is the one you want to run as a service.

MORE INFORMATION

The OS/2 Subsystem automatically shuts down when a user logs off. Using the /S switch on the Os2.exe command line tells the OS/2 Subsystem that it is running in the context of a service. The Subsystem then continues to run across logons.

The reason the application must be the first OS/2 executable launched is that if an OS/2 Subsystem server is present, it will be used rather than starting a new one to run as a service.

Any OS/2 applications launched by the interactive user will still be terminated upon logoff.


KBCategory: kbprg kbhowto
KBSubcategory: BseService
Additional reference words: 3.50 4.00 os2 os2ss service


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.