2012/11/12 Keith Marshall <keithmarshall@users.sourceforge.net>

How is this obfuscation an "improvement"?  The "@echo off" is completely
unnecessary; (it is useful only within a cmd batch file, which this bash
shell function is not).  Since you don't need the "@echo off", neither
do you need the ugly escaped ampersands.

Even if you do have a weird system configuration, which results in
cmd.exe echoing the command given with "cmd //c"

   $ winpath(){ cmd //c @echo "$@"; }

should suppress it.

Here it shows "ECHO está ativado" (echo is active), your new version shows that too. That other version with @echo off suppresses this message.

BTW, the variant using "pwd -W" can be expressed succinctly as:

   $ winpath(){ ( cd "$1" && pwd -W ); }

but remains inferior, since it will work only for path names which
represent an existing *directory*, whereas the cmd variant works with
any MSYS path name, directory or file, or even non-existent.