We help IT Professionals succeed at work.
Get Started

perl CGI script hangs calling powershell.exe

2,277 Views
Last Modified: 2013-12-25
Please help!  I usually have no issue gathering output from command line using perl with the SYSYEM() or backticks `` and placing the results into variable. That is, until I tried to call the output of powershell.exe. The most basic command:

powershell.exe -command "& echo hello"

The perl script will run fine from the command line, however, running the same script from CGI via web browser fails. If I substitute the powershell command for any standard windows command I will see the output in the browser so it's not a script issue

I have also tried calling from a batch file:
@go = system "C:\\Inetpub\\wwwroot\\manage\\test.bat";

... I don't think this is a perl issue but rather IIS/windows restriction with powershell.exe. Other people have also been experiencing this issue:

http://www.eggheadcafe.com/software/aspnet/31891003/powershell-starts-but-ne.aspx

Any thoughts on this?

Many Thanks
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE