I'm using Eagle 7.7.0 and making ulp file to generate all gerber/drill files.
My code is
int pos = strstr(EAGLE_PATH, "eagle.exe");
dir_eaglecon = strsub(EAGLE_PATH, 0, pos) + "eaglecon.exe";
dir_eaglecon = replace_string(dir_eaglecon , "/" , "\\" );
gerber_cmd = "cmd.exe /c " + dir_eaglecon;
string s;
sprintf(s, "%s -X -dGERBER_RS274X -o\"%s\\%s%s\" \"%s%s\" %s", gerber_cmd, dir_gerber, release_name, gerberNames[i], dir_original, filename(B.name), gerberUsed[i]);
system(s);
it works perfectly with eaglecon.exe in C:\EAGLE-7.7.0\bin\
When I install program to C:\Program Files (x86)\EAGLE-7.7.0\bin\ ==> Error message: "...is not recognized as an internal or external command, operable program or batch file."
I'm aware that the new path of eaglecon.exe has "space" and need to be surrounded with quotation marks, so I update my code like:
gerber_cmd = "cmd.exe /c " + "\"" + dir_eaglecon + "\"";
However, the system(s) return 1 (Error) and cannot generate gerber file. In addition, when I manually type the command in cmd line, it also works perfectly with quotation surrounded eaglecon.exe path.
Please kindly help to get it works with my new program directory. I've tried setup new path in environment variables but does't work so far.