Hello,
Are you communicating via serial or GPIB? When you say "manually it is fine", are you sending the command via Hyperterminal or perhaps in Measurement and Automation?
It sounds as though this is a termination character issue; if you use Hyperterminal to send a serial command, it automatically appends a termination character when you hit "enter" after a line (I would guess a '\r' or '\n' or both). I would first experiment with these characters, and also check the manual for your instrument to see what termination method it requires.
Scott