Using Shell on a OS X program

When I use the Shell command to start a OS X program (plus the required parameters), the Shell returns an error.

bash: /Users/paul/Desktop/NCReportConsole/NCReport.app: is a directory

I have to use the package contents of the application to make it work.

/Users/paul/Desktop/NCReportConsole/NCReport.app/Contents/MacOS/NCReport

Source code:
nShell is defined as a public Shell property.

  Dim p As String
  Dim oFile As String = "/Users/paul/Desktop/test.pdf"
  p = "-f /Users/paul/Reports/test.ncr -c Test_rpt -q QSQLITE -d /Users/paul/Reports/Databases/Test.db -o pdf -of " + oFile
  
  'Dim f As folderitem = New folderitem("/Users/paul/Desktop/NCReportConsole/NCReport.app/Contents/MacOS/NCReport", FolderItem.PathTypeNative) // Works
  Dim f As folderitem = New folderitem("/Users/paul/Desktop/NCReportConsole/NCReport.app", FolderItem.PathTypeNative) // Does not work
  Dim a As String = f.ShellPath
  
  nShell = New Shell
  nShell.Mode = 0  
  nShell.Execute (a, p)

I have also tried to use open in shell command, but that give error: open: “invalid option – c”.

nShell.Execute ("open " + a, p)

Is there a way to use the application with the Shell command or is using the package content the only way?

If you use arguments for the open command, you should use the --args option.

open [-e] [-t] [-f] [-F] [-W] [-R] [-n] [-g] [-h] [-b bundle_identifier] [-a application] file …
[–args arg1 …]

Example:
open /Users/paul/Desktop/NCReportConsole/NCReport.app --args -f /Users/paul/Reports/test.ncr -c Test_rpt -q QSQLITE -d /Users/paul/Reports/Databases/Test.db -o pdf -of

Test this in a terminal, before using it in your application.

Thank you Horst.
You pointed me in the right direction.

The code is now:

nShell.Execute ("open " + a, "--args " + p)

This works flawlessly.