RE: Connecting to a drive

2002-11-04 Thread Larry Sandwick
Thanks for the quick response, using the print command I saw the error
of my way !!! 

I had a space in $node.

Thanks again for the help !!!

---Larry

-Original Message-
From: Jenda Krynicky [mailto:Jenda@;Krynicky.cz] 
Sent: Monday, November 04, 2002 3:41 PM
To: [EMAIL PROTECTED]
Subject: Re: Connecting to a drive

From: "Larry Sandwick" <[EMAIL PROTECTED]>
> I am trying to write a Perl script that will replicate a directory on
> one computer to another. All of the computers are running XP. I do
> have administrative privileges.
> 
> The problem is when I run the line below I never get connected to the
> computer from within the scripted.
> 
>  system "net use m: \\$node\\c\$   user:/username
> password";

Try to print the command instead of executing it. You'll see the 
problem.

You may also want to try

use Win32::FileOp; # http://Jenda.Krynicky.cz/#Win32::FileOp

Map 'M:' => "$node\\c\$", 
{user => $username, passwd => $password, overwrite =>
1};

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Connecting to a drive

2002-11-04 Thread Jenda Krynicky
From: "Larry Sandwick" <[EMAIL PROTECTED]>
> I am trying to write a Perl script that will replicate a directory on
> one computer to another. All of the computers are running XP. I do
> have administrative privileges.
> 
> The problem is when I run the line below I never get connected to the
> computer from within the scripted.
> 
>  system "net use m: \\$node\\c\$   user:/username
> password";

Try to print the command instead of executing it. You'll see the 
problem.

You may also want to try

use Win32::FileOp; # http://Jenda.Krynicky.cz/#Win32::FileOp

Map 'M:' => "$node\\c\$", 
{user => $username, passwd => $password, overwrite => 1};

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Connecting to a drive

2002-11-04 Thread Nikola Janceski
remember what \ does in these ""

try:
system "net use m: $nodec\\$ 
user:/username password";


remember for one \ you need \\
for 2 \ you need 


> -Original Message-
> From: Larry Sandwick [mailto:lgs@;sarreid.com]
> Sent: Monday, November 04, 2002 3:31 PM
> To: [EMAIL PROTECTED]
> Subject: Connecting to a drive
> 
> 
> Hello,
> 
>  
> 
> I am trying to write a Perl script that will replicate a directory on
> one computer to another. All of the computers are running XP. 
> I do have
> administrative privileges.
> 
>  
> 
> The problem is when I run the line below I never get connected to the
> computer from within the scripted.
> 
>  
> 
>  system "net use m: \\$node\\c\$   user:/username
> password";
> 
>  
> 
> The error I get from the line is a syntax error.
> 
>  
> 
> If I map the drive manually my script works.(That's no good when you
> have to do it 40 times )
> 
>  
> 
> Any suggestions would be appreciated 
> 
>  
> 
> Thanks for your help! 
> 
>  
> 
> Larry Sandwick
> 
> Sarreid, Ltd.
> 
> Network Administrator
> 
> (252) 291-1414 x223
> 
>  
> 
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]