I use perl for this, but I am not sure if the problem is perl realted. Here goes anyway...

We have a exe that needs to be run every hour (scheduled task). But before it can be run a few files need to be created from databases and text files and so on...which we use Perl to do.

So our schedule is a perl script that does the things it needs to do in perl, and then uses system() to run the exe.

However, our exe is failing to run. We don't exactly know why, but for some reason it will only run when there is a user logged in, and that user id is the same one that the job is running under.

The exe is an external program that cannot be changed.

So I figure that maybe to solve this I need to fake a login of the user_id running the job, so that when there is no one logged into the server (most of the time) then the job will still work.

Does anyone know if there is a way in Perl for windows to simulate a login?

For information, the user_id running the job has been tested with every possible NT priv, just incase there was a way to do it that way...still not working properly.

Any suggestions would be appreciated.

Thanks


In reply to Win NT user impersonation in Perl by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.