Hi Arild,
I don't want to start another process as such. Just like
System () Function in C++ which can execute the DOS
command. i would like to have the command executed for as
part of the running console application.
[quoted text, click to view] >-----Original Message-----
>Use the Process.Start() method with cmd.exe as the
command and /C "command"
>as the parameters. This will start a new process, and
possible a new console
>window, I'm not sure if the command will inherit the
current console, so you
>may have to write your own code to do this.
>
>Arild
>
>"Justine" <amith_justine@hotmail.com> wrote in message
>news:046d01c3b7d0$aa6237f0$a501280a@phx.gbl...
>> Hi All,
>>
>> How can v execute DOS command while executing Console
>> Application written using C#, like cls,dir commnads.
>>
>>
>> Thanz in Advance,
>> Justine
>
>
>.
That, I'm afraid is not possible... You'd need to create a Process "cmd.exe"
and execute all your DOS commands thru it.
vJ
[quoted text, click to view] "Justine" <anonymous@discussions.microsoft.com> wrote in message
news:04a801c3b7d9$1cefce10$a401280a@phx.gbl...
> Hi Arild,
>
> I don't want to start another process as such. Just like
> System () Function in C++ which can execute the DOS
> command. i would like to have the command executed for as
> part of the running console application.
>
> >-----Original Message-----
> >Use the Process.Start() method with cmd.exe as the
> command and /C "command"
> >as the parameters. This will start a new process, and
> possible a new console
> >window, I'm not sure if the command will inherit the
> current console, so you
> >may have to write your own code to do this.
> >
> >Arild
> >
> >"Justine" <amith_justine@hotmail.com> wrote in message
> >news:046d01c3b7d0$aa6237f0$a501280a@phx.gbl...
> >> Hi All,
> >>
> >> How can v execute DOS command while executing Console
> >> Application written using C#, like cls,dir commnads.
> >>
> >>
> >> Thanz in Advance,
> >> Justine
> >
> >
> >.
> >
Use the Process.Start() method with cmd.exe as the command and /C "command"
as the parameters. This will start a new process, and possible a new console
window, I'm not sure if the command will inherit the current console, so you
may have to write your own code to do this.
Arild
[quoted text, click to view] "Justine" <amith_justine@hotmail.com> wrote in message
news:046d01c3b7d0$aa6237f0$a501280a@phx.gbl...
> Hi All,
>
> How can v execute DOS command while executing Console
> Application written using C#, like cls,dir commnads.
>
>
> Thanz in Advance,
> Justine
take a look at the start command, something like "start /B cmd.exe /C dir"
should do what you are after.
Willy.
[quoted text, click to view] "Justine" <anonymous@discussions.microsoft.com> wrote in message
news:04a801c3b7d9$1cefce10$a401280a@phx.gbl...
> Hi Arild,
>
> I don't want to start another process as such. Just like
> System () Function in C++ which can execute the DOS
> command. i would like to have the command executed for as
> part of the running console application.
>
> >-----Original Message-----
> >Use the Process.Start() method with cmd.exe as the
> command and /C "command"
> >as the parameters. This will start a new process, and
> possible a new console
> >window, I'm not sure if the command will inherit the
> current console, so you
> >may have to write your own code to do this.
> >
> >Arild
> >
> >"Justine" <amith_justine@hotmail.com> wrote in message
> >news:046d01c3b7d0$aa6237f0$a501280a@phx.gbl...
> >> Hi All,
> >>
> >> How can v execute DOS command while executing Console
> >> Application written using C#, like cls,dir commnads.
> >>
> >>
> >> Thanz in Advance,
> >> Justine
> >
> >
> >.
> >