473,378 Members | 1,449 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 9460
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.