Thanks for the help, but I guess I should've been more clear. I meant to
ask how do you do this in Perl? Specifically through a CGI script? I have
figured out how to do it from a regular script, but when I run it through a
browser, no dice.
Here's my regular script:
#################################
use Win32::NetResource;
$servername="blah";
$ShareInfo = {
'path' => "a:\\",
'netname' => "Adrive",
'remark' => "This is your A drive on drugs",
'passwd' => "",
'current-users' =>0,
'permissions' => 0,
'maxusers' => -1,
'type' => 0,
};
Win32::NetResource::NetShareAdd( $ShareInfo,$parm, $servername )
or die "unable to add share";
$filename="\\\\$servername\\Adrive\\test.txt";
print "$filename\n";
open(FD, ">$filename");
print FD "Hello, sucker\n";
close (FD);
################################
Here's my CGI script
use CGI qw/:standard/;
use Win32::NetResource;
$query = new CGI;
$query->use_named_parameters(1);
$ip=$ENV{REMOTE_ADDR},
$servername="blah",
$ShareInfo = {
'path' => "a:\\",
'netname' => "Adrive",
'remark' => "It is good to share",
'passwd' => "",
'current-users' =>0,
'permissions' => 0,
'maxusers' => -1,
'type' => 0,
},
Win32::NetResource::NetShareAdd( $ShareInfo,$parm, $servername )
or die "unable to add share",
$filename="\\\\blah\\Adrive\\test.txt",
print "$filename\n",
open(FD, ">$filename"),
print FD "Hello, sucker\n",
close (FD),
print header,
start_html("Learning to Write Remotely"),
h1("Lets write a file to you're A drive"),p,
"Your IP address is $ip",p,
end_html;
#################################
It's probably a permissions thing doing it through CGI, but I can't figure
it out. The regular script only works if I first establish an IPC
connection to the remote machine, so I guess I have to do something similar
with the CGI version. Any ideas?
James
-----Original Message-----
From: Attrill, Ross [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 10, 2000 6:37 PM
To: Perl-Win32-Users Mailing List
Subject: Re: Add a remote share
Is your problem with using the netresource module or with sharing the
directory on the remote machine?
Assuming the problem is with sharing the remote machine then as long as the
remote machine is NT you can do the following:
- log onto the machine with admin privileges
- use NT explorer to go the directory you want to share
- right click and select sharing.
Ross Attrill.
**********************************************************************
This e-mail may be confidential and only the intended
recipient may access or use it. If you are not the intended
recipient, please delete this e-mail and notify the sender
immediately.
The contents of this e-mail are the writer's opinion and are
not necessarily endorsed by Delta Electricity unless
expressly stated.
We use virus scanning software but exclude all liability for
viruses or similar in any attachment.
**********************************************************************
---
You are currently subscribed to perl-win32-users as:
[EMAIL PROTECTED]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]