Advertisement

01.22.2005 at 08:13AM PST, ID: 21284455
[x]
Attachment Details

problem with executing system() command through cgi-bin

Asked by apa050 in Perl Programming Language

Tags: command, system, cgi

i need to exexute a command through cgi that is located in C:\Program Files\Some Program\ directory, hovever when i have this in my perl script (among other things):

system("C:\Program Files\Some Program\runit.exe");

it doesnt run and the following would appear in the apache error log:

[Sat Jan 22 10:05:33 2005] [error] [client 192.168.0.5] 'C:Program' is not recognized as an internal or external command,\r
[Sat Jan 22 10:05:33 2005] [error] [client 192.168.0.5] operable program or batch file.\r

btw, when i try to escape \ the error says .... 'C:\\Program' is not recognized ...

Looks like this is a problem with white spaces in the path.

How can I execute this command without physically renaming my directories to eliminate white spaces?

When I add the path to the invironment and just do this:
system("runit.exe");

the error says:
[Sat Jan 22 09:56:27 2005] [error] [client 192.168.0.5] 'runit.exe' is not recognized as an internal or external command,\r


when i run the script manually from the command line (in the cgi directory) it works fine, but when i try to run it through the web browser it generates the above error.

Any suggestions on how to get this to work?

Start Free Trial
[+][-]01.22.2005 at 11:10AM PST, ID: 13111711

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2005 at 11:35AM PST, ID: 13111789

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2005 at 11:38AM PST, ID: 13111801

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2005 at 11:40AM PST, ID: 13111806

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: command, system, cgi
Sign Up Now!
Solution Provided By: FishMonger
Participating Experts: 4
Solution Grade: A
 
 
[+][-]01.22.2005 at 11:42AM PST, ID: 13111815

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2005 at 06:02PM PST, ID: 13113537

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2005 at 09:37PM PST, ID: 13113947

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.23.2005 at 07:06PM PST, ID: 13118201

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.14.2005 at 09:20PM PST, ID: 13310998

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02.19.2005 at 12:38AM PST, ID: 13352454

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32