Hello:
I made a small ulp which invoke eaglecon from inside eagle to get eps drawing, using system("cmd.exe /c path\eaglecon etc.....");
I noticed that this command fails if the path even quoted include space (in my case "C:\EAGLE-7.7.0 x32\bin\eaglecon")
I got: Windows cannot fond '-X', Make sure you typed the name correctly and then try again.
my ulp:
string cmd,fname,bname,path,path2,rot,quick;
int i;
string convert(string dumy)
{
string dumy2,ch;
int i;
rot="";
quick="";
dumy2="";
for(i=0;i<strlen(dumy);i++) {
ch=strsub(dumy,i,1);
if(ch=="/") ch="\\";
dumy2=dumy2+ch;
}
return dumy2;
}
path=path_doc[0];
path="\""+strsub(path,0,strlen(path)-4)+"\\bin\\eaglecon"+"\"";
path=convert(path);
if(board){
board(B){
bname=B.name;;
//dlgMessageBox("bname1="+bname);
bname=convert(bname);
//dlgMessageBox("bname2="+bname);
fname=bname;
fname[strlen(fname)-4]=0;
for(i=1;i< argc; i++) {
if(argv[i]=="rot") rot=" -r ";
else if(argv[i]=="quick") quick=" -q+ ";
else if(argv[i]=="sol") {
cmd="cmd.exe /c start echo " + path + rot+quick+ " -X -f- -deps -o\""+fname+"_sol.eps\" \""+bname+"\" 16 17 18 20";
system(cmd);
cmd="cmd.exe /c start " + path + rot+quick+ " -X -f- -deps -o\""+fname+"_sol.eps\" \""+bname+"\" 16 17 18 20";
system(cmd);
}
}
//dlgMessageBox(cmd);
}
}
I've added "echo" for verification, typing the echoed string in a command window succeed.
Everything worked OK if I remove the space in "C:\EAGLE-7.7.0 x32", like "C:\EAGLE-7.7.0x32"
is there a way to resolve that?
Thanks