> sub createNewShare
> {
> my( $path, $user, $computer, $securityDescriptor ) = @_;
>
> my ( $shareInfo );
>
> $shareInfo = { 'path' => $path,
> 'netname' => "$user".'$',
> 'remark' => "$user"."'s Home directory",
> 'security_descriptor' => $securityDescriptor,
> 'max_uses' => -1,
> 'type' => 0,
> };
> if( Win32::Lanman::NetShareAdd( "$computer", \%$shareInfo ))
> {
> print "Share created\n";
> } else {
> print "Share creation failed\n";
> print "error: Win32::Lanman::GetLastError()\n\n";
> }
> }
>
> When I run my script on a my local computer this code works fine, if I try
> and run it from my computer to create a share on a member server I get this
>
> Share creation failed
> Error: 2116
>
> The only thing I change when trying to set up the share on the member server
> is the computer name and path.
Well the 2116 means : "The device or directory does not exist."
Are you sure the path is correct? Make sure the path exists and is
local ON THE SERVER !
Say the server shares c:\ and \\server\c$ and you have mapped it to
e:\. Now even though the code runs on your machine, the path will be
c:\some\directory\on\the\server not e:\some\directory\on\the\server !
Jenda
P.S.: PLEASE DO NOT DOUBLEQUOTE VARIABLES !!!
"$varname" means the same as $varname !
== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
: What do people think?
What, do people think? :-)
-- Larry Wall in <[EMAIL PROTECTED]>
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin