Output of one command as input to another command

  • Dear Friends,

    I want redirect the output of xp_fixeddrives to xp_cmdshell so that i can net send the space available in my server to all my team members.

    Thanks & Regards

    Chandra Mohan N

    [font="Verdana"]Thanks
    Chandra Mohan[/font]

  • Insert results from xp_Fixeddrives into a temp table as such:

    CREATE TABLE #DriveTable (Drive CHAR(1), [MB Free] int)

    INSERT INTO #DriveTable

    EXEC master..xp_fixeddrives

    SELECT *

    FROM #DriveTable

    DROP TABLE #DriveTable

     

    Now, use t-sql to query the temp table and build the message string that you will pass into the net send command in xp_cmdshell.

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

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

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