this piece of code will not run:
PHP Code:
exec("$_GET[CMD] C:\php\test\WAV.EXE C:\php\test\".$foo." /Q"); 
you have a black slash before a double quote, and PHP interprets a single backslash as being used for escaping a character. you need to escape that back slash, like so:
PHP Code:
exec("$_GET[CMD] C:\php\test\WAV.EXE C:\php\test\\".$foo." /Q"); 
by the way, all of those "rn" that you have -- they're supposed to be "\r\n", not just "rn". it represents a proper line break.