Xp_cmdshell command shell

Source: Internet
Author: User

Xp_cmdshell command shell

This process is an extended stored procedure used to execute a specified command string and return any output as a text line.

Syntax:
Xp_cmdshell command_string [, no_output]

Command_string command string to be executed
No_output does not return the output of Command Execution

Note:

When you grant the execution permission of xp_cmdshell to a user, you can run
The account that runs SQL Server Shell (usually a local system) has any execution privilege
Operating system commands.

Example:

1. EXEC master .. xp_cmdshell "dir *. exe"
Returns the list of executable files.

2. EXEC master .. xp_mongoshell "copy d: est1.jpg e:" no_output
No output is returned.

3. Especially for execution
EXEC master.. xp_mongoshell "net start awhost32"
EXEC master.. xp_mongoshell "net stop awhost32"
You can start and stop remote PCAnywhere services. It is very helpful for remote server operations.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.