Peter Lemus writes ..

>I need to execute a windows 2000 command through a
>perl script on a different machine. can someone give
>me an example on how to accomplish this.
>
>I mapped a drive for example:
>system "net use x: \\\\myserver\myshare"

for starters the above will turn into the following on the command line

  net use x: \\myservermyshare

because you didn't double the second backslash


>now I can go to X:
>
>How can I execute the command on the remote machine:
>some thing like:
>system "xcacls $line /g $line:r /E \n"; # set the
>permissions
>
>I need to run this on the remote machine though.

well .. what "run this on the remote machine" means depends on the situation
.. as another contributor has already said - you may need rsh or something
if you want to run \\myserver's version of xcacls as if you were on
\\myserver itself

but if you're happy to run your machine's version of xcacls (which should be
fine for this particular example) then you'll obviously need to be logged
into your own machine with an account that gives you administrative access
to \\myserver

if not then you can have a look at Win32::AdminMisc::CreateProcessAsUser
(and Win32::AdminMisc::LogonAsUser) which will enable you to create a xcacls
process under a given user context and THAT user will need to have
administrator access to \\myserver

Win32::AdminMisc is available from

  http://roth.net/perl/

-- 
  jason king

  In Hibbing, Minnesota, it shall be the duty of all policemen to kill
  all cats running at large. - http://dumblaws.com/

Reply via email to