INF: xp_cmdshell Does Not Retrieve User Input

Last reviewed: April 29, 1997
Article ID: Q115184

The information in this article applies to:
  • Microsoft SQL Server, version 4.2

SUMMARY

Programs that require user input should not be executed through the extended stored procedure xp_cmdshell. xp_cmdshell does not support running MS-DOS programs that require user input.

MORE INFORMATION

There is no way to get the user input from any DB-Library (DB-Lib) client utility to the server. xp_cmdshell was designed to suppress the console window on the server and not allow user input. It will run internal MS-DOS commands and 32-bit programs that require user input and return back to the client utility, but there is no way to provide user input back to the program. Running external MS-DOS commands that require this input will cause the DB-Library client to wait indefinitely for this input and never return control to the client. The SQL Server process will remain active and cannot be terminated using the kill command.

xp_cmdshell was not designed to allow user input to programs. To achieve this functionality, a new extended stored procedure can be written.


Additional query words: Windows NT
Keywords : kbprg SSrvWinNT
Version : 4.2
Platform : WINDOWS


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: April 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.