Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2009
    Posts
    4

    Question Unanswered: Operating System Command (CmdExec) in SQL Server????

    Hi
    I am scheduling a bunch of jobs to run daily.. One of the command prompts job keeps failing...
    This works if you open up Command Prompt
    C:\salesforce.com\Apex\bin>process.bat "C:\salesforce.com\Apex\test" databasewsExtractProcess

    But when I place it in SQL Server Agent /jobs...
    as C:\salesforce.com\Apex\bin\process.bat "C:\salesforce.com\Apex\test" databasewsExtractProcess
    I also tried without quotes did not work...
    I get the following error:

    The system cannot find the path specified. Process Exit Code 1. The step failed.

    It will not run???
    Can some one please help me ... I have other stuff and they work fine like C:\salesforce.com\Apex\bin\ws.exe

    Thank You
    Shan

  2. #2
    Join Date
    Feb 2009
    Posts
    2

    use CMD.EXE

    Use:

    C:\Windows\System32\cmd.exe /C C:\salesforce.com\Apex\bin\process.bat C:\salesforce.com\Apex\test databasewsExtractProcess


    Doron Saar,

    Nob Hill Software - tools for database people (+ free stuff!) Nob Hill Software - tools for database people (+ free stuff!)
    Nob Hill Software: Tools for Database People

  3. #3
    Join Date
    Feb 2009
    Posts
    4

    Red face Get the same error...

    Hi This is the steps I did:
    I went into SQL Server Agent ==> Jobs
    Double Click on my Job
    Went into Edit mode (Type=Operating System Command (CmdExec)
    Placed in C:\Windows\System32\cmd.exe /C C:\salesforce.com\Apex\bin\process.bat C:\salesforce.com\Apex\test databasewsExtractProcess

    And got the same error that
    The system cannot find the path specified. Process Exit Code 1. The step failed.

    I am guessing SQL Server can not do .bat files?
    Because it works for .exe files...
    Any thoughts?
    Thanks
    Shan

  4. #4
    Join Date
    Aug 2008
    Location
    India
    Posts
    55
    does SQL server account startup account has administrator permission at OS level ?

  5. #5
    Join Date
    Feb 2009
    Posts
    4

    Question It process the bat files without parameters but...

    Yes it does... It can execute the process file without the parameters see below

    C:\Documents and Settings\196817>C:\Windows\System32\cmd.exe /C C:\salesforce.com\Apex\bin\process

    Usage: process <configuration directory> [process name]

    configuration directory -- directory that contains configuration files,
    i.e. config.properties, process-conf.xml, database-conf.xml

    process name -- optional name of a batch process bean in process-conf.xml,
    for example:

    process ../myconfigdir AccountInsert

    If process name is not specified, the parameter values from config.prop
    erties
    will be used to run the process instead of process-conf.xml,
    for example:

    process ../myconfigdir
    ???
    In my case its like this:
    C:\Documents and Settings\196817>C:\Windows\System32\cmd.exe /C C:\salesforce.com\Apex\bin\process ../test databasewsExtract

  6. #6
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    If you are using any relative paths (i.e. ..\test) in your command, you will probably have this error. SQL Server is not necessarily starting in the directory you want. To prove this out, run a job that simply pipes the output of CD to a text file.

  7. #7
    Join Date
    Feb 2009
    Posts
    4

    Question hmmm

    So what should I do?
    How do I make this work then?
    Thanks for helping me out.. everyone

  8. #8
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    It could be that the process.bat file also has some relative filepaths to it. Try issuing a cd command to get to an appropriate directory, then process.bat. This is not two jobsteps, but all in one. If that is not possible, you may try to make your own wrapper .bat file that does what you need it to do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •