By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,606 Members | 2,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,606 IT Pros & Developers. It's quick & easy.

"Net Use" command in a browser

100+
P: 296
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
Share this Question
Share on Google+
4 Replies


numberwhun
Expert Mod 2.5K+
P: 3,503
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
Expert 2.5K+
P: 4,059
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

100+
P: 296
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

100+
P: 296
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.