SQL Server Agent and cscript

  • I am trying to run a bat file thru an operating system command in a step in a job.  The bat file executes a runas command that runs cscript

    Runas /savecred /user:<domain>\<user> "C:\WINDOWS\system32\cscript O:\Batch\Trizetto\Facets\441\System\Bin\ErSys0FrmExecuteJob.wsf --Region="gehaweb" --runbook="o:\Batch\Trizetto\Facets\441\Customer\runbook\gehaweb\gehawebErCmcRunPib0.xml""

    The bat file runs fine on its own but when I start the job nothing happens.  In the event log I see the following:

    Application popup: cscript.exe - Application Error : The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.

    When I go into taskmanager I see a process with my user and the cscript process present but it is not doing anything.

    Any ideas?

    Thanx

  • The server probably has Internet Explorer Enhanced Security installed.

    When the job runs, it pops up a dialog box to ask if you really want to run CSCRIPT.  Since it is a batch job, there is no way for it to respond to the GUI dialog box, so the job just hangs.

     

     

     

  • Thanx for the input but it didn't help.

    I uninstalled the security and retested but got the same results.  In the event log I saw the following error again and in Task Manager there is a cscript process present but it is not doing anything:

    Application popup: cscript.exe - Application Error : The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.

     

  • Is there a drive O: mounted on the server?  Remember, jobs run on the server, not your machine.  You should probably use the share name instead of a drive letter.

    Steve

  • I am running from the server so there was an O drive.

    However, as it turns out I found a different way to run the job without a runas command.

    Thanx everyone for your help!

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

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