469,307 Members | 2,482 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

"Net Use" command in a browser

296 100+
The below code is not printing the results in a browser as expected :

Expand|Select|Wrap|Line Numbers
  1. #!C:/apache2triad/perl/bin/perl.exe use strict; 
  2. use CGI qw(:standard); 
  3. &main(@ARGV);
  4.  sub main 
  5. {
  6.  my $query = CGI->new(); 
  7. print $query->header; 
  8. print `net use`; 
  9. }

The output as shown below is not showing the network drives unlike in the command prompt:


Expand|Select|Wrap|Line Numbers
  1. New connections will be remembered. There are no entries in the list. 
Sep 8 '08 #1
4 2629
numberwhun
3,503 Expert Mod 2GB
Question, are you trying to run the command 'net use' in your perl script and have the output sent to a web page?

I don't know that it would actually do it or not. You might have to capture the output and then display it.

Regards,

Jeff
Sep 11 '08 #2
KevinADC
4,059 Expert 2GB
The CGI script will run as a different user than a command line script, which might affect what the 'net' command returns.
Sep 11 '08 #3
pankajit09
296 100+
The CGI script will run as a different user than a command line script, which might affect what the 'net' command returns.


I changed the user of the Apache Web Server.

Still no result.
Sep 18 '08 #4
pankajit09
296 100+
Question, are you trying to run the command 'net use' in your perl script and have the output sent to a web page?

I don't know that it would actually do it or not. You might have to capture the output and then display it.

Regards,

Jeff


I am calling a Perl EXE from a PHP file.

The PHP file is run from the browser.
Sep 18 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Mullin Yu | last post: by
1 post views Thread by test63 | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.