deleting through xp_cmdshell

  • HI,

    Thank you for the replies.

    I can use rmdir to delete a folder - but now i want to check through stored procedure if that folder exists then delete or remove from the hard drive.

    How to do this checking.

    Thnx,

    Natalie.

  • Have you tried including the no_output parameter?

    xp_cmdshell {'command_string'} [, no_output]

     

    I wasn't born stupid - I had to study.

  • I use this:

    xp_cmdshell 'del /Q  {your stuff here}'

    The /Q means quiet mode and doesn't ask for confirmation.

    MG

    "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
    Tony Hoare

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.

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

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