To cause a program to run on another server, you'd need a protocol for doing that. Under NT, "Remote Cmd" (aka "RCmd") from the resource kit is not bad (rlogin and rsh from the resource kit are not good). If you installed the service on serverB, the service was running, you have rcmd.exe on serverA, and you are properly authenticated to serverB, then you could use:

rcmd \\serverb path\test1.bat
But I won't go into this further because I don't think that is the best solution in this particular case.

When you run a program from Explorer, it usually runs the program with its default directory set to the directory where Explorer found the program. It sounds like just setting the default directory before running the program may fix your problem.

Now, you can't chdir('//serverB/directory$') because non-kernel processes on NT need a drive letter for their current directory. So you need to map a drive letter to that directory and chdir to the root directory of that drive. Win32::NetResource will let you map and unmap the drive letter.

I don't have Win32::NetResource examples handy or memorized so here is a non-Perl solution:

pushd \\serverB\directory$ test1.bat popd


In reply to RE: Re: External programs by tye
in thread External programs by clrobert

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.