Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Run Dos command in Asp.Net applications

4 views
Skip to first unread message

senthilmuruga

unread,
Jul 29, 2006, 2:53:43 AM7/29/06
to
Hi Everybody,

I have installed CVS which is a concurrent versioning system. I want to
execute the CVS commands (DOS based commands) from my Asp.Net
applications.

Anybody please tell me how to run CVS commands (Dos commands) from
Asp.Net!

Thanks in advance...

Roland

unread,
Jul 29, 2006, 4:19:21 AM7/29/06
to
Checkout System.Diagnostics.Process API

System.Diagnostics.Processp = new Systems.Diagnostics.Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "cmd";
p.StartInfo.Arguments = "..."; // Your command and args here
p.StartInfo.RedirectStandartOutput = true;

p.Start();
p.WaitForExit();

string output = p.StandardOutput.ReadToEnd();

or similar.

Regards


Hitesh Ramchandani

unread,
Jul 29, 2006, 4:26:17 AM7/29/06
to
You can use Process.Start

Process process = new Process();
process.StartInfo.FileName = "CVS.exe";
process.StartInfo.Arguments = "if any";
process.Start();


-Hitesh Ramchandani.


"senthilmuruga" <senthil...@angleritech.com> wrote in message
news:1154156023.1...@s13g2000cwa.googlegroups.com...

senthilmuruga

unread,
Jul 31, 2006, 12:51:49 AM7/31/06
to
Hi Guys,

Thanks for your response.

As you said I execute this code in page load event. But nothing was
happenned,

System.Diagnostics.Process runner = new System.Diagnostics.Process();
runner.StartInfo.UseShellExecute=false;
runner.StartInfo.FileName = "cmd.exe";
runner.StartInfo.Arguments = "copy c:\\bsm\\a.txt c:\\bsm\\b.txt";
runner.StartInfo.RedirectStandardOutput=true;
runner.Start();

What could be the problem!

senthilmuruga

unread,
Jul 31, 2006, 1:39:28 AM7/31/06
to
In the following line I typed wrong:

runner.StartInfo.Arguments = "copy c:\\bsm\\a.txt c:\\bsm\\b.txt";

plz take this line: runner.StartInfo.Arguments = "copy c:\bsm\a.txt
c:\bsm\b.txt";

0 new messages