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")
'and...
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.

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

IO.Directory.SetCurrentDirectory("C:\MyFolder")
Shell("ProcessText file1 file2")

2. you specify the complete path to the application

Shell("C:\MyFolder\ProcessText file1 file2")

One thing to remember, since you're working with VB.NET you really should stick with the native libraries available to you in the Framework, Shell is a legacy item left over from the VB6 days. For this you should be using the Process Class in the System.Diagnostics Namespace

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.