CommandShellWithResults Method

SQLServer Object

Description

Executes an operating system command. Output from the command is returned in a QueryResults object.

Visual Basic

QueryResults = SQLServer.CommandShellWithResults ( [Command :=] strCommand )

C++

HRESULT pSQLServer->CommandShellWithResults (
SQLOLE_LPCSTR
strCommand,
LPSQLOLEQUERYRESULTS*
ppQueryResults );

Elements

Element Type Description

QueryResults QueryResults Returned QueryResults object
strCommand String Operating system command

Remarks

The contents of the QueryResults object depend on the operating system command.

Reference

xp_cmdshell