Shell Command: Works on Windows, not on OS X

I have the following command I want to execute on OS X:

  Dim TheTestCommand As String
  TheTestCommand = "wszst"
  Dim ToolShell As New Shell
  MsgBox ToolShell.Result

It works great on Windows. However, it does not on OS X. I have executed the command manually (via Terminal) and it does indeed work, even when I use “bash” and then “wszst”.

For the script:

Any ideas?

Yeah - Understand - I tried to do similar stuff on the Mac that was a breeze on windows.
I had to go the long way around.
Sorry for your woes


On OS X you dont get a restored environment so the PATH environment variable is probably not set
Use a fully qualified path to the command you want to run

To add to Norman’s reply: To find out where a program is located, use the command “which”, e.g. like this:

$ which zip



And, you can use the “env” command to see what the PATH variable is actually set to:

  Dim sh As New Shell
  MsgBox sh.Result

Sorry for the really late reply, but have figured out what do to:

  #If TargetMacOS and TargetLinux //Tool installs in same place on both Linux and OS X.
    Dim sh As New Shell
    sh.Execute("/usr/local/bin/wszst", "extract", SzsManagerWindow.UniversalFilePath.Text)
  #ElseIf TargetWin32
    Dim sh As New Shell
    sh.Execute("wszst", "extract", SzsManagerWindow.UniversalFilePath.Text)

er, should the and be an or ?


Didn’t know that there was an ‘or’. (Hadn’t really used it in other languages, so.)