For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > November 2004 > Running a DOS app under iIS?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Running a DOS app under iIS?
Brian Hancock

2004-11-20, 3:55 pm

Hi

I am having trouble getting a DOS executable program to run from my PERL
script. I have been successfully running the scripts under apache 2.0 and
ActivePERL 5.8 on my XP box, with both the local client and remote clients.
When I uploaded the script to my webhost which run IIS5 I get an "Access
Denied". The webhost's support have been unable to help me.

I have am now trying it out on my IIS5.0 on Windows 2000, and although I am
not getting the same error message, my application is not running as
expected.

I thought it might be easier to use a different DOS program than my app in
case it was the problem so I have been trying the old faithful pkunzip.exe
and am getting some unexpected results.

If you start pkunzip at a command prompt without any parameters eg
c:\>pkunzip
then you get a help message sent to stdout..

To test an archive you start PKUnzip
c:\pkunzip -t myzip.zip
and if the zipis is ok then a message verify the integrity of the zip is
sent to stdout.

Various version of my PERL script to start PKUnZip have been

#!c:\perl\bin\perl.exe -w
#unzip.pl
print "Content-type:text/html\n\n";
system("pkunzip")
print "<html>" ;
system("pkunzip.exe -t myzip.zip")
print "Done" ;
print "</html>" ;

The only output is "Done":

changing the System line to:
system("cmd /c pkunzip.exe");
is far better as I receive the expected Help message

I eventually got at least something along the lines I wanted with with:
system("cmd","/c","pkunzip.exe","-t",
"c:\\inetpub\\wwwroot\\cgi-bin\\myzip.zip")
However although it can fine the myzip.zip file the error message coming
from PKUnzip is that is can't open it?

I can run the script from the Command Prompt by just type zip.pl and it runs
fine.

Can anyone shed some light on this.

By the way, I think I mentioned it earlier but I have no problems when
running this under Apache.

Thanks
Brian



Michael Coats

2004-11-22, 3:55 pm

Hi,

You might need to set the execute permission on the pkunzip exe for the
iusr_local_machine or whatever user it is that IIS uses. Or maybe even try
fiddling with permissions on the files that the program works on - just
because your user can run the programs and access the files, doesn't mean
that IIS' user account can.

HTH,
Mike

-----Original Message-----
From: Brian Hancock [mailto:brian.hancock@brileigh.com]
Sent: 20 November 2004 11:53
To: beginners-cgi@perl.org
Subject: Running a DOS app under iIS?

Hi

I am having trouble getting a DOS executable program to run from my PERL
script. I have been successfully running the scripts under apache 2.0 and
ActivePERL 5.8 on my XP box, with both the local client and remote clients.
When I uploaded the script to my webhost which run IIS5 I get an "Access
Denied". The webhost's support have been unable to help me.

I have am now trying it out on my IIS5.0 on Windows 2000, and although I am
not getting the same error message, my application is not running as
expected.

I thought it might be easier to use a different DOS program than my app in
case it was the problem so I have been trying the old faithful pkunzip.exe
and am getting some unexpected results.

If you start pkunzip at a command prompt without any parameters eg
c:\>pkunzip then you get a help message sent to stdout..

To test an archive you start PKUnzip
c:\pkunzip -t myzip.zip
and if the zipis is ok then a message verify the integrity of the zip is
sent to stdout.

Various version of my PERL script to start PKUnZip have been

#!c:\perl\bin\perl.exe -w
#unzip.pl
print "Content-type:text/html\n\n";
system("pkunzip")
print "<html>" ;
system("pkunzip.exe -t myzip.zip")
print "Done" ;
print "</html>" ;

The only output is "Done":

changing the System line to:
system("cmd /c pkunzip.exe");
is far better as I receive the expected Help message

I eventually got at least something along the lines I wanted with with:
system("cmd","/c","pkunzip.exe","-t",
"c:\\inetpub\\wwwroot\\cgi-bin\\myzip.zip")
However although it can fine the myzip.zip file the error message coming
from PKUnzip is that is can't open it?

I can run the script from the Command Prompt by just type zip.pl and it runs
fine.

Can anyone shed some light on this.

By the way, I think I mentioned it earlier but I have no problems when
running this under Apache.

Thanks
Brian





########################################
########################################

This message is intended only for the use of the persons ("The intended recipients") to whom it is addressed. It may contain information which is privileged and confidential within the meaning of applicable law. If you are not the intended recipient, plea
se contact the sender as soon as possible. The views expressed in this communication may not necessarily be the views held by James Jones & Sons Ltd.
########################################
########################################

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com