I have following line of code. I want to set relative path instead of hardcoded path as is presently set in 2nd argument below-
sysExecCmd("Unlock_Ecu.bat","","D:\\Program Files\\ToolPath");
Should be replaced as:
sysExecCmd("Unlock_Ecu.bat","","...\\ToolPath");
How can I do it in sysExecCmd function of Capl ?
I usually do it as listed below:
variables
{
char absPath[256]; // Holds Abs Path for current CFG file
// Relative Path for ToolPath folder
char ToolPath[100]= "\\ToolPath\\";
}
on preStart
{
/* Get Abs path of current config file */
GetUserFilePath("", absPath, 256);
Exec_Batch();
}
void Exec_Batch()
{
/* Get Absolute Path for executing Bat file */
char absToolPath[256];
strncat(absToolPath, absPath, strlen(absPath));
strncat(absToolPath, ToolPath, strlen(absToolPath) + strlen(ToolPath));
write("Executing Batch File");
sysExecCmd("Unlock_Ecu.bat","",absToolPath);
write("Finished execution of Batch File");
}