The problem with your current approach is that you are missing %COMSPEC% which the pipe '|' requires. There is a FAQ on that.
Quote:

Is there a better way of getting Display Name from the AD



Yes. COM ADSI would be the way to go. There are lots of examples posted on the board.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.