I'd like to have a windows forms application execute a command line instruction similar in structure to the following:

ProcessText file1 file2

where ProcessText is a working console tool for automated text processing, file1 is the text I need processed, and file2 is the created text output. From the command line I can get this to work so long as I'm in the same directory with ProcessText and file1. But I'm trying to automate the process for an unknown number of files within my form application.

So far I've tried:

System.Console.WriteLine("ProcessText file1 file2")
Shell("ProcessText file1 file2")

but it refuses to run ProcessText.
Per other threads I've found, I'm also trying to build this as a separate project, a Windows Console Application, without any progress.
Again, per other threads, I've included these COM References: MSScriptControl, Scripting, and Scriptlet.
I've also attempted to write the command line instruction I need to a unique, build on demand, batch file, and then run it. But, obviously that didn't work either.
Any tips? Search criteria suggestions? Any advise would be greatly appreciated.

6 Years
Discussion Span
Last Post by PsychoCoder

two options you have:
1. you change the working directory

Shell("ProcessText file1 file2")

2. you specify the complete path to the application

Shell("C:\MyFolder\ProcessText file1 file2")
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.