Am 09.11.2020 um 18:19 schrieb user@domain.invalid:
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 + rotquick " -X -f-
-deps -o\""fname"_sol.eps\" \""bname"\" 16 17 18 20";
system(cmd);
cmd="cmd.exe /c start " + path + rotquick " -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
Looks like you use windows. Unfortunately you didn't tell which version.
In newer versions of windows there are user "groups", means that your
path could be something like
C:\USER (your name)\eagle etc.
Check that out first, then check if you can reach your program via CMD,
to verify that the complete path is correct.
--
Mit freundlichen Grüßen / With best regards
Joern Paschedag