Run EXE from SQL

  • Hi,

    I have an EXE file which i would like to run, what i am doing is running following script but in void.... 🙁

    declare @sqlcmd varchar(200)

    SET @sqlcmd = 'WinWSSList.exe'

    EXEC master..xp_cmdshell @sqlcmd

    Now what it gives me as output is :

    'WinWSSList.exe' is not recognized as an internal or external command,

    operable program or batch file.

    NULL

    What to do ??

    Thanks

    Parth

  • The exe would first have to be in a directory where SQL Server has privs. Then, you should either add that directory to the permanent PATH or explicitly name the drive and directory in the command.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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