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.