Hello gentlefolk,
I am having trouble getting the Role Tailored client to run an outside program. Here is the error I am getting:
"This message is for C/AL programmers. The call to member Run failed: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)."
The RTC is set up with the client on the workstation and the other two tiers on a single server. Here is the code in question. A couple of things to note: first, this same code runs without a hitch on the Classic side in NAV 2009. Secondly, if I point Docfile to a bogus path, I get the "EXE not found" confirm window.
DocFile := 'F:\Old Storage Drive\Payroll_import\Payroll_Import.exe';
DocComp := ' "'+CONVERTSTR(COMPANYNAME,'.','_')+'"';
IF FILE.EXISTS(docfile) THEN
BEGIN
IF ISCLEAR(wShExec) THEN CREATE(wShExec,FALSE,TRUE);
WshMode := 0;
WaitForEndOfCommand := FALSE;
ReturnCode := wShExec.Run(docfile +
DocComp,WshMode,WaitForEndOfCommand);
END ELSE
IF CONFIRM('EXE Not FOUND!') THEN CurrPage.UPDATE(FALSE);
END;
So it's a NAV error saying it can't find the file, but I know it CAN find the file because if I point it elsewhere it gives me the confirm window. I confess I am puzzled. Any ideas? Thanks in advance...
Comments
based on your code, it would be
F:\Old Storage Drive\Payroll_import\Payroll_Import.exe"mycompanyname"
and such a file can't exist...
i think your code is not correct, here
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
At the point of the Run, Nav debugger shows the value of cmdstring as "F:\Payroll_import\Payroll_Import.exe "Company Name, Inc_""
If I go to Start/Run and enter F:\Payroll_import\Payroll_Import.exe "Company Name, Inc." it works perfectly. "Company Name, Inc_" is correctly passed as a parameter. If I run this same code in NAV Classic it works just fine. The problem insn't in the syntax, unless RTC requires a different syntax. That's what I don't know... does anyone?
Thanks...
where's the exe file? i think on the client machine. if so, the service tier cannot read it. you have to put the exe file in a place accessible from service tier. (and with the correct path).
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Thanks man!
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog