The only way I can see this working is having extra tools installed:
- Scripts: The command parsers are extremely different between the Mac (bash shell) and Windows (which has 2: PowerShell and the original, don't know its technical name). You'd either have to have Services for Unix/Cygwin/Insert-other-UNIXy-Environment here installed on the Windows box, or use something like perl or another scripting language. In either event, at least the Windows box, and possibly the Mac, need additional out-of-box tools.
- Executables: The only way you can pull this off is to use Java, .NET/Mono or some other cross-platform bytecode-based virtual machine environment. Hence, you are still dependent on tools which are not in-box. (IIRC, Java doesn't ship with Windows, and Mono doesn't ship with Mac.)
- Other Issues: The biggest issue you'll run into after dealing with the tool dependency is that paths are identified differently on both systems. Understanding that Mac paths are generally Unix-style paths (although I believe "old-school" Mac colon-separated paths are still valid). You'll also have to deal with different file locations and default locations based on both environments. This will be a pain.
Now, if you can get away with using a cross-compile instead of binary compatibility, you may have an answer in a tool called RealBasic. It was originally Mac-based, but there are versions for Windows and Linux as well. I used to play around with it in the early part of this decade, and it was pretty neat, but not something I ever used professionally. This will, if you're careful, allow you to write the code once, and compile the very same code as native Mac, Linux and Windows applications.