472,990 Members | 3,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,990 software developers and data experts.

How to run system commands through perl script in Windows Server 2008 R2?

For example,runnig "ipconfig" command through perl script and printing it on web browser.
Expand|Select|Wrap|Line Numbers
  1. my $cmd = "ipconfig";
  2. my $output = `$cmd`;
  3. print $output;
  4.  
Above code works fine in Windows Server 2003,but $output is null in Windows Server 2008 R2.

Done necessary settings in IIS for perl,is there additional settings in windows server 2008 R2 for perl?
Is there a way to make above mentioned code to work in Windows Server 2008 R2.
Using perl 5.6 version.


Appreciate your help.
Jan 28 '11 #1
8 9442
numberwhun
3,509 Expert Mod 2GB
@output will definitely be null. In the code you provided above, you are storing it in $output. Two totally different containers.
Jan 29 '11 #2
Sorry ,@output is typo mistake,it is $output.
Jan 30 '11 #3
chorny
80 Expert
1. Try running it from command line. Does it work?

2. Try using system instead of ``. Does it return any error?
Jan 30 '11 #4
Thanks for quick reply
1.It does works through command prompt.
2.system returns 0.
Jan 30 '11 #5
chorny
80 Expert
It is possible that IIS runs command with lowered privileges.

Try running it as `$cmd 2>&1`. Does it return any error message?
Jan 30 '11 #6
It returns NULL,
How can I increase previlages in IIS?
Iam trying to run web Application in windows server 2008 R2 which works fine in Windows Server 2003.Web app uses both perl and cgi.Several pages are not working because of system command call using backtik.
One more thing I tried redirecting output to file,which is working.Since there are lot files using system command I do not want do this.
Need your valuable suggestions.
Jan 31 '11 #7
we have got the same problem. Have you found a solution or at least the reasons why the backtick command in perl suddenly doesn't work with windows server 2008 r2.
Jun 9 '11 #8
RonB
589 Expert Mod 512MB
Try specifying the full path or use a module which extracts the info from the registry.

Win32::IPConfig
Jun 10 '11 #9

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

Similar topics

3
by: =?Utf-8?B?T2xpdmllciBNQVRST1Q=?= | last post by:
I'm trying to run an ASP.NET 2.0 web site on Windows Server 2008 RC1. I encounter a server error : HTTP 500.19 - Configuration data is invalid IIS7 claims that the <appSettingssection in web.config...
2
by: Odd B Andersen | last post by:
Does DB2 support Windows Server 2008? In the Information Center for 9.5 I only find mentioned Windows Server 2003 and Windows Vista. -- Regards Odd Bjørn Andersen ErgoGroup AS
1
by: GatorDBA | last post by:
Hey Folks, Experiencing strange problem with SQL 2005 running on Windows Server 2008. When trying to connect via named pipes or tcp, it takes 25-45 seconds for the connection to be established....
1
by: =?Utf-8?B?bWFzYWtpeQ==?= | last post by:
Hello, I'm trying to develop 32-bit Windows Native C/C++ application using Visual Studio 2008, on 64-bit Windows Server 2008. Q1. Is it possible to develop 32-bit C/C++ application using VS 2008...
2
by: Michael Richard | last post by:
Hi, I need a help from you. I'm writing device driver for 64 bit Windows Server 2008. I have code for 32 bit Windows Server 2008, its working fine on 32 bit. I need a help to port from 32 bit...
1
by: JDeats | last post by:
It's been a few years since I worked with transaction based components, last time I was involved in an enterprise project requiring transactions my .NET .DLLs were dervived from ServicedComponent...
0
by: Fernan MC | last post by:
Hi, I am making a program using vb 2005 and using list and label 12 for the reports. I compiled the program and installed it in windows server 2008 but unfortunately the list and label will not...
1
by: =?Utf-8?B?QW50amU=?= | last post by:
I need product keys for Terminal Server Windows Server 2008 access (CALs) under MSDN - TSLM Service said they cannot provide product keys for the access.
0
by: Bhavesh Patel | last post by:
hi we have installed virtual sound driver in windows server 2008, but still not play our voice files in windows server 2008, we havn't physical audio device in our server. anybudy have idea for...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.