• Looks like just a path issue. Is the account executing the script able to run sqlcmd from the context of the folder that holds the script file? (log on as script user, open cmd prompt, navigate to script folder, exec sqlcmd to see if it runs).

    You may need to add the path to sqlcmd (and also ensure the file is installed) to that user's profile, or use the fill path to sqlcmd in your script.

    For example, on my laptop, the command would be C:\mssql\DefaultInstance\100\Tools\Binn\sqlcmd.exe <...parameters...>

    Eddie Wuerch
    MCM: SQL