quote $ characters in cmds correctly for windows (as well as linux and mac which were already working)