hi,
I need to mount a samba share from Perl. This is the code:
#!perl
use warnings;
use strict;
use Win32::NetResource;
my %netresource = (
RemoteName => "\\\\server\share" ,
);
my $username = "user" ; # also tried "workgroup\\user"
my $password = "password" ;
# print "$username\n" ;
# print "$password\n" ;
my $mapping = Win32::NetResource::AddConnection(
\%netresource, $username, $password, 0 ) or warn win32err();
sub win32err {
my $err;
Win32::NetResource::GetError($err);
Win32::FormatMessage($err);
}
When I run it, I get:
Z:\scripts>perl mapshare.pl
The specified network password is not correct.
I know the username/password combo is correct, because using net use
it works. I have tried adding the workgroup to the $username like so:
$username = "workgroup\\user" but to no avail.
The samba server is not a part of a domain, it has its own workgroup.
Has anyone gotten such a setup to work?
TIA,
--
Groeten,
natxo
_______________________________________________
Perl-Win32-Admin mailing list
Perl...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs