EXEC XP_CMDShell running in SSMS 2012

  • EXEC XP_CMDSHELL 'net use /delete *'

    Need to find out how to feed a "Y" answer into the execution of this command.

    Trying to delete this post!

  • sulman.sqldba (4/18/2016)


    EXEC XP_CMDSHELL 'net use /delete *'

    Need to find out how to feed a "Y" answer into the execution of this command.

    Trying to delete this post!

    Add a /y to the command line.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • xp_cmdshell isn't interactive, so anything you run here would have to run without any additional input from the command line.

    I have been able to automate things like http://ftp.exe by using an input file. Have commands in a text file that are sent to the exe with a < (input)

    Ref: https://technet.microsoft.com/en-us/library/bb490982.aspx

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply