Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » System Procedures » System procedures

sp_tsql_environment system procedure Next Page

xp_cmdshell system procedure


Carries out an operating system command from a procedure.

Syntax

xp_cmdshell(
command
[ , 'no_output' ] )

Arguments
Remarks

xp_cmdshell executes a system command and then returns control to the calling environment.

The second parameter affects only console applications on Windows operating systems. For Unix, no output is displayed regardless of the setting for the second parameter. For NetWare, any commands executed are visible on the server console, regardless of the setting for the second parameter.

For NetWare and Windows CE, any commands executed are visible on the server console, regardless of the setting for the second parameter. On Windows CE, the console shell \\windows\cmd.exe is needed to run the procedure.

Permissions

DBA authority required

See also
Example

The following statement lists the files in the current directory in the file c:\temp.txt:

xp_cmdshell( 'dir > c:\\temp.txt' )

The following statement carries out the same operation, but does so without displaying a command window.

xp_cmdshell( 'dir > c:\\temp.txt', 'no_output' )