entint
asked on
perl CGI script hangs calling powershell.exe
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\\man age\\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
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\\man
... 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
try giving full path to powershell.
check if cgi has sufficient permissions
check if cgi has sufficient permissions
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can right-click on the script and change the user and password for that CGI program in the IIS Manager utility. Technically, you can change cgi-bin in general, but I don't recommend putting Administrator on more than is necessary.
My educated guess is that the IIS default user does not actually have permissions to execute PowerShell. That could be due to something about PowerShell itself, or it could be due to PowerShell's location, assuming I'm right at all.