I am trying unsuccessfully to implement the following:
Run a command in command line (cmd.exe) while the command will use parameter
read from a text file.
The user will select the file to read in a winform and the same command will
run in a loop while using in each run the value in 1 single line in the text
file.

Can someone please advise what is the best way to do that?

Thanks a lot

Re: Running command line commands with parameters read from a text by Hayato

Hayato
Sun Apr 27 00:37:14 CDT 2008

Are you trying to have your window form application use a text file
when it starts? Couldn't you pass the path to the text file and
receive it in static Main(string[] args) ?

On Apr 25, 10:07=A0am, orit <o...@discussions.microsoft.com> wrote:
> I am trying unsuccessfully to implement the following:
> Run a command in command line (cmd.exe) while the command will use paramet=
er
> read from a text file.
> The user will select the file to read in a winform and the same command wi=
ll
> run in a loop while using in each run the value in 1 single line in the te=
xt
> file.
>
> Can someone please advise what is the best way to do that?
>
> Thanks a lot


Re: Running command line commands with parameters read from a text by Thiago

Thiago
Wed Apr 30 13:50:25 CDT 2008

On 27 abr, 02:37, Hayato Iriumi <hiri...@gmail.com> wrote:
> Are you trying to have your window form application use a text file
> when it starts? Couldn't you pass the path to the text file and
> receive it in static Main(string[] args) ?
>
> On Apr 25, 10:07 am, orit <o...@discussions.microsoft.com> wrote:
>
> > I am trying unsuccessfully to implement the following:
> > Run a command in command line (cmd.exe) while the command will use parameter
> > read from a text file.
> > The user will select the file to read in a winform and the same command will
> > run in a loop while using in each run the value in 1 single line in the text
> > file.
>
> > Can someone please advise what is the best way to do that?
>
> > Thanks a lot

Using StreamReader to read line per line, you can run a command with
Process class (http://msdn.microsoft.com/en-us/library/
system.diagnostics.process.aspx). Loop through txt lines concatening
the parameter to your command and run the process, till it ends
(WaitForExit).

Hope it help

Thiago