You need to put in a delay (through the keyboard software, not in the actual macro). There's lag between the keyboard and the client, so if the command line is pumped into the client at full speed, some characters are skipped, thus rendering the command incoherent causing it to fail. Trial and error, man.