Yeah...follow this link and your question will be answered.

http://www.codeguru.com/network/xCmd.html

Hope this helped a bit!