CmdExec .bat file Failed

  • I am running .bat file via SQL server schedule job under "Operating System (CmdExec)" command and my command is: E:\script\RunMy.bat

    file.

    It is giving me below error message:

    Executed as user: MYSERVER_NT\SQLAGTdb. C:\Windows\system32>cd E:\data-integration\ C:\Windows\system32>Kitchen.bat /file:E:\Kettle-ETL\NextGen\Patient_Processing_with_start_audit.kjb /level:Basic 1>E:\Log\NextGenMPIJob.log 'Kitchen.bat' is not recognized as an internal or external command, operable program or batch file. Process Exit Code 1. The step failed.

    Now I have give all the folder and file a necessary read and write permission and also added MSSQLSERVER$SQLAGNT$...**** account as well,

    My OS: Win Server 2008 R2

    Now, I have same job that run fine on SQL Server 2005 with Window Server 2005 but I am trying to migrate my process.

    Please let me know your thoughts.

    Thanks

    Key

  • I have to admit that I tried using this option in jobs, possibly in sql 2000 but found it problematic, can't remember why now, may have been to do with return codes and getting the step to record a success/fail.

    Since then I've always used xp_cmdshell. ( yes I know there are possible issues with xp_cmdshell )

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • Yes, Agree with your CSS... but it is very strange that it does work with SQL 2005 but 2008R2 giving me hickups....

    I will continue to do further investigation and let you know if find any solution.

    Thanks

    Key

  • to me, the error looks like the Kitchen.bat is not found in any of the folders in the %PATH% variable.

    the call looks like oyu expect it to exist inside \Windows\system32 folder...is that where it really is?

    if you change ot to call it with the full path , ie E:\data-integration\Kitchen.bat(or wherever it really is), does that work?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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