xp_cmdshell and .BAT execution

  • i have a .BAT file which successfully calls a FTP process to download files. it runs successfully when you simply double click the BAT file.

    when i try calling that BAT file from xp_cmdshell, it fails on login credentials.

    i am executing the BAT file and the SQL call from the same server

    what are, if any, the behavior differences between using xp_cmdshell from SQL Server 2005 and simply double clicking a BAT file to execute?

    why would one work and not the other?

    something has changed because the cmdshell was working two days ago!

    thanks for any advice in advance.

  • Primary difference is that when the .bat file is executed from SQL sp_cmdshell is that it runs under the context of the SQL Service account (unless your using a proxy account). When you click on the bat file it runs as the logged in user. If it uses or requires any auth then this is likely your issue.

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

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