GetCommandLine() Under Win32s

Last reviewed: December 18, 1996
Article ID: Q102762
The information in this article applies to:
  • Microsoft Win32s versions 1.0, 1.1, 1.2, 1.30, 1.30a, 1.30c

SUMMARY

Under Win32s, GetCommandLine() includes the full drive/path of the executable, while under Windows NT GetCommandLine() does not include the full path.

MORE INFORMATION

When programs are run from the Program Manager or the File Manager on Windows 3.1, they are spawned using the full path. As a result, argv[0] will have the complete path. When a Win32s application is spawned by a 16-bit application, Windows detects that the application is a Win32s application. The full path is passed to Win32s regardless of whether or not WinExec() was invoked with the full path. As a result, 32-bit applications receive the full path.

When a Win32-based application is spawned from another Win32-based application, the 32-bit kernel passes the information as given by the parent process (that is, if a Win32-based application is started via CreateProcess() from another Win32-based application, argv[0] will contain the path that the spawning application passed in).


KBCategory: kbprg kbhowto
KBSubcategory: W32s
Additional reference words: 1.00 1.10 1.20 1.30 1.30a 1.30c cmdline


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 18, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.