As for your first question... Writing a series of code in command line for me is impossibe.... Unless you save it as batch...

As for the second question... If your refering to an executable files and you want to run it in command line... Try to copy the Program in the path where your command.com resides... But usually in XP it is commonly found in <B> indows\System32\ </b