Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I connect to an NT share?

Status
Not open for further replies.

Tve

Programmer
May 22, 2000
166
FR

Hi,

I need to connect to an NT share to get some info (file contents, sizes, ....). Before I do this, I should be recognized on the sever. From the command line, I usually use the:
[tt]
NET USE \\server\share .....
[/tt]

I could do a system command from within my perl script , but I don't find this very neat ( handling errors).

How would you do it within Perl?

AD AUGUSTA PER ANGUSTA

Thierry
 
Hi,

Check the Win32::LanMan module, it's on CPAN .. dunno what it does, but it's a module and it should work (I've read)

Grtz Funs

funs@euro.net
 
Thierry,

what about running the net command from within your perl script and the examining the results?

there are two ways I know of to do this, the second is probably more appropriate to Perl on windows

open(NET, 'net_command|') || die;
while(<NET>){
$net_output .= $_;
# each line of output from net
}
print $net_output;

or....

$net_output = `net_command`;
print $net_output;
Mike
&quot;Experience is the comb that Nature gives us after we are bald.&quot;

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top