BUG: Only One Double-Quoted String Allowed in xp_cmdshell String

This article was previously published under Q266224
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 58037 (SQLBUG_70)
BUG #: 217533 (SHILOH>
SYMPTOMS
Commands that are run by xp_cmdshell, which contain two or more parameters delimited by sets of double-quotes, do not run correctly. When you run the following command from the Query Analyzer:
EXEC master..xp_cmdshell '"C:\whats this\prgm.exe" -i "c:\test dir\SQL.txt"'				
the following error message occurs:
'C:\whats' is not recognized as an internal or external command.
WORKAROUND
Create a batch file to run the operations and then run that batch file by using xp_cmdshell.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
xp_cmdshell and spaces in directory names, double quoted string
Properties

Article ID: 266224 - Last Review: 01/16/2015 20:28:13 - Revision: 3.2

Microsoft SQL Server 7.0 Standard Edition, Microsoft SQL Server 2000 Standard Edition

  • kbnosurvey kbarchive kbbug kbpending KB266224
Feedback