I'm trying to make a program that reads the dump file from an exe in the command prompt.

I have the exe that does what I want, but it's run in a command prompt. It can dump its output to a text file. So, I'm going to have it so the person enters a computer name (which goes into variable ComputerName), and when the program runs it will shell the command line which dumps to a text file, then the "front end" will import the data into a list box.

At a command prompt, you can type:

program.exe \\computername >c:\text.txt

and it'll dump the info to a text file. But if I do

Code:
Shell "C:\program.exe " & ComputerName & " >c:\text.txt", vbNormalFocus
it runs, but the exe says it can't find the process >c:\text.txt (info on specific processes is another thing it can do)

If I run just

Code:
Shell "C:\program.exe " & ComputerName
It works fine, of course it shows the data in the window, and doesn't dump into a text file that way

So it looks like the problem is happening after the variable. I've tried using vbKeySpace instead of an actual space and some other silly stuff that didn't work. Anyone know what VB might be doing when it passes the command through, that would be making it see the command differently than plain old "program.exe \\computername >c:\text.txt"?