I needed to add cmd in front of the command such as:
command = "cmd wmic product get Name > textfile.txt"
in addition to using the cmd keyword there are also several switches you can use depending on your needs. You can see them by typing cmd /? in a command prompt window.
Here are a couple:
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K (see below)
/Q Turns echo off
/D Disable execution of AutoRun commands from registry (see below)
/A Causes the output of internal commands to a pipe or file to be ANSI
/U Causes the output of internal commands to a pipe or file to be Unicode