Can Mingw32/Msys run dos/cmd.exe executables without screwing up the arguments?

Solution 1:

Ok, the proper answer follows.

To escape the arguments such that dos executables can be used, you double the slashes, such as:

growlnotify //a:Application //t:Title "message here"

The reason it would fail for me was because somehow I wasn't using the same application name as I had when I started the day before (and as a different application it was unregistered, and Growl For Windows ignores unregistered notifications).

There are a few other tricks worth mentioning. In CMD, you can issue the statement like this:

growlnotify //a:App //t:"With Spaces" "message here"

The "With Spaces" bombs. I think msys/bash may be expanding the quotes, and then passing it in, such that the executable sees two arguments, //t:With and Spaces". The correct way to do that seems to be:

growlnotify //a:App //t:With\ Spaces "message here"

Also, if you pass in any filepaths, you'll still want to use DOS-style, which means slashes (since ultimately it's the DOS-like executable that will consume that). But those will be interpreted as escapes, which means they have to be doubled as well.

growlnotify //a:App //ai:C:\\path\\to\\icon.png "message here"

Hope this helps someone in the future.

Solution 2:

Have you tried running "cmd.exe /c growlnotify.exe ..." from MinGW?