Different Behavior Between Interactive Logon and Batch Job/Service Account for COM Object Interaction

Anonymous
2024-08-29T12:39:54+00:00

I'm encountering an issue with a legacy COM object that was developed for local use within my company (I don't have the source code). I have a Java program that interacts with this COM object, specifically calling a method that involves another language.

I created a batch file to run this Java program via a scheduled task. Here's the problem:

  • When the task is set to "Run only when user is logged on" (interactive logon), the program produces the expected result.
  • When the task is set to "Run whether user is logged on or not" (as a batch job), the program returns null.

The Java environment I'm using is JRockit v1.6 x86, and I interact with the COM object using JACOB Dispatch, sending an ActiveXComponent of the COM object.

Things I've Tried:

  1. Simplified the code to only interact with the COM object—no change in behavior.
  2. Printed all accessible properties from the COM object—properties are identical in both methods.
  3. Tried logging in as different users—same result.
  4. Used PowerShell to interact with the COM object—works as expected in ISE, but returns null in the PowerShell console.
  5. Attempted to run the Java program as a service account—again, null is returned.
  6. Printed from within the language method—this prints successfully.

Any insights or suggestions on why this discrepancy occurs and how to resolve it?

Windows Server Identity and access User logon and profiles

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-08-29T13:36:56+00:00

    Hello

    Thank you for posting in Microsoft Community forum.

    We found that your post is the same as your post below. Because it is a duplicate post, we reply to you in the post below. Thank you for your understanding and support.

    Different Behavior Between Interactive Logon and Batch Job/Service - Microsoft Community

    If you have any question or concern, please feel free to let us know.

    Best Regards,

    Daisy Zhou

    0 comments No comments