How to define an exe filename to run?

Aravindh_NavisionAravindh_Navision Member Posts: 258
Hi Friends,

I have done the program to run an exe from Navision program which is given below. This is working successfully.
IF ISCLEAR(WSHShell) THEN BEGIN
  CREATE(WSHShell);
  WinStyle := 0;
  WaitForCommand := FALSE;
  WSHShell.CurrentDirectory := 'C:\Program Files\TestUAT_160212\';
  WSHShell.Run('"C:\Program Files\TestUAT_160212\recex1.exe"',WinStyle);
  CLEAR(WSHShell);
END;

My requirement is to run an .exe file which is something like this i.e., instead of recex1.exe, I need to mention as
recex1.exe /recex /xml

If I give the statement as below,
WSHShell.Run('"C:\Program Files\TestUAT_160212\recex1.exe /recex /xml"',WinStyle);

I am getting an error as follows...
This message is for C/AL programmers:

An exception was raised in method Append. The OLE control or Automation server has returned error (HRESULT) -2147352567. The component did not provide the exception description.

Can any one help me how to define it?

Thanks in advance,
Aravindh R.

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You probably misplaced the "-character. Try this:
    WSHShell.Run('"C:\Program Files\TestUAT_160212\recex1.exe" /recex /xml',WinStyle);
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    Thanks a lot Luc Van Dyck. It worked... \:D/
Sign In or Register to comment.