@ChrisH
You can get a copy of the WB search path using the WorkbenchControl() function from workbench.library (version >= 44).
This is the code that I use in AutoRun for that purpose:
void ExecuteAutoRun (CONST_STRPTR command) {
BPTR path = ZERO;
BPTR stdin, stdout, stderr;
int32 error;
IWorkbench->WorkbenchControl(NULL,
WBCTRLA_DuplicateSearchPath, &path,
TAG_END);
stdin = IDOS->Open("NIL:", MODE_OLDFILE);
stdout = IDOS->Open("NIL:", MODE_OLDFILE);
stderr = IDOS->Open("NIL:", MODE_OLDFILE);
if (stdin && stdout && stderr) {
error = IDOS->SystemTags(command,
NP_Name, "AutoRun Script",
SYS_Asynch, TRUE,
NP_Path, path,
NP_CloseError, TRUE,
SYS_Input, stdin,
SYS_Output, stdout,
SYS_Error, stderr,
TAG_END);
if (error != -1) {
return;
}
}
if (path != ZERO) {
IWorkbench->WorkbenchControl(NULL,
WBCTRLA_FreeSearchPath, path,
TAG_END);
}
IDOS->Close(stdin);
IDOS->Close(stdout);
IDOS->Close(stderr);
}