Hi,
    I'm in trouble issuing the netsh command from PerlScript on Windows 2000.
 
This is my test case:
 
Windows 2000 Server
ActivePerl 623
 
I created an ASP page as follows:
 
# --------------------------Cut Here
 
<%@ LANGUAGE = perlscript %>
<PRE>
<%
my $cmd="netsh interface ip dump";
open(OUT, $cmd."|");
while(<OUT>) {
 $Response->Write($_);
}
close(OUT);
%>
</PRE>
 
# --------------------------Cut Here
 
Directory security in IIS is set to require basic authentication and I log in as the local Administrator
 
opening the page the result is:
 
# --------------------------Cut Here
 
# ----------------------------------
# Interface IP Configuration        
# ----------------------------------
pushd interface ip



popd
# End of interface IP configuration
# --------------------------Cut Here
 
You can see that there are no interfaces listed...
 
If I run the same code (logged on as the same user) adapted for natural perl:
 
# --------------------------Cut Here
 
my $cmd="netsh interface ip dump";
open(OUT, $cmd."|");
while(<OUT>) {
 print $_;
}
close(OUT);
# --------------------------Cut Here
 
the result is:
 
# --------------------------Cut Here
 
# ----------------------------------
# Interface IP Configuration
# ----------------------------------
pushd interface ip
 

# Interface IP Configuration for "Local Area Connection"
 
set address name = "Local Area Connection" source = static addr = 192.168.1.3 mask = 255.255.255.0
set dns name = "Local Area Connection" source = static addr = none
set wins name = "Local Area Connection" source = static addr = none
 

popd
# End of interface IP configuration
 
# --------------------------Cut Here
 
You can correctly see network settings for the LAN adapter installed in my PC; the same result is achieved obviously when I run "netsh interface ip dump" from command prompt.
 
Any idea about this behavior?
I think I'm running the scripts in the same user context, so what's missing?
 
Thanx
    Luigino.
 
Luigino Masarati
 

Reply via email to