troca de diretorio para executar um terceiro script c++
Olá
eu fiz um servidor web com nginx, como este nao tem painel para restart/close entao eu fiz um em c++:
--- #include<stdlib.h>
#include<stdio.h>
#include<dos.h>
main(int argc, char *argv[])
{
int option;
int php;
int nginx;
//char execphp[100];
printf("\t ***************************************************** \n");
printf("\t \t INICIAR SERVICOS WEB - PHP, NGINX \n");
printf("\t ***************************************************** \n");
printf("\n");
printf("1- Iniciar PHP \n");
printf("2- Iniciar NGINX \n");
printf("3- Iniciar ambos \n");
printf("4- Sair \n");
//execphp = ' c:\\nginx\\php\\php-cgi.exe -b "127.0.0.1:9000" -c c:\\nginx\\php\\php.ini ';
system("cd C:\\nginx\\conf ");
php = system("start start-php.bat");
nginx = system("start ../start-nginx.exe");
//z= system(execphp);
printf("PHP: %d",php);
printf("NGINX: %d",php);
system("PAUSE");
}
--- o meu problema seriam 2 na verdade
de trocar o diretorio para executar um segundo .exe
e escapar a linha: //execphp = ' c:\\nginx\\php\\php-cgi.exe -b "127.0.0.1:9000" -c c:\\nginx\\php\\php.ini ';
tentei escapar ela de varias formas e nao consegui
se alguem puder me ajudar, agradeço
eu fiz um servidor web com nginx, como este nao tem painel para restart/close entao eu fiz um em c++:
--- #include<stdlib.h>
#include<stdio.h>
#include<dos.h>
main(int argc, char *argv[])
{
int option;
int php;
int nginx;
//char execphp[100];
printf("\t ***************************************************** \n");
printf("\t \t INICIAR SERVICOS WEB - PHP, NGINX \n");
printf("\t ***************************************************** \n");
printf("\n");
printf("1- Iniciar PHP \n");
printf("2- Iniciar NGINX \n");
printf("3- Iniciar ambos \n");
printf("4- Sair \n");
//execphp = ' c:\\nginx\\php\\php-cgi.exe -b "127.0.0.1:9000" -c c:\\nginx\\php\\php.ini ';
system("cd C:\\nginx\\conf ");
php = system("start start-php.bat");
nginx = system("start ../start-nginx.exe");
//z= system(execphp);
printf("PHP: %d",php);
printf("NGINX: %d",php);
system("PAUSE");
}
--- o meu problema seriam 2 na verdade
de trocar o diretorio para executar um segundo .exe
e escapar a linha: //execphp = ' c:\\nginx\\php\\php-cgi.exe -b "127.0.0.1:9000" -c c:\\nginx\\php\\php.ini ';
tentei escapar ela de varias formas e nao consegui
se alguem puder me ajudar, agradeço
Ciro Vargas
Curtidas 0
Respostas
José
28/04/2011
Este tópico esta sendo fechado por inatividade. Se necessário, sinalizar para que seja reaberto ou abrir um novo.
GOSTEI 0