Ask a Question related to ASP.NET General, Design and Development.
-
Allan Rojas #1
Shell commands in ASP.NET?
Hi,
I want to execute a shell command and retrieve the output of it, is there a
method to do it? All i have found is how to start a process (cmd /C), but i
cannot retrieve the result of the command execution.
For example, it would be ideal if there would be a method like:
string result = ExecuteShellCommand("dir *.txt");
thnx in advance...
Allan Rojas Guest
-
Unable to execute shell commands
Windows 2003 ISS 6.0 That's your problem ;) try using: Linux Debain Apache 1.3 Then it will execute the shell commands. windows does not... -
shell repeat commands
in ksh, i can do the below 1) history 2) r history-number but for csh, i cant do the same. are there any similar alternatives? -
Windows Shell Commands
Hi, how can i use windows shell commands with ruby ? I would like to call existing command line programs with parameters given by ruby. I am a... -
How do I escape shell commands?
Is it possible to do something to a string so that it gets escaped for a shell command (i.e. if I'm executing a command and I have the file name... -
[PHP] executing shell commands.
I am executing the following within PHP - $system = `/bin/ls /dcsa-ws1/share/webadm1/public_html/system-reports/security/rhosts/eqty | /bin/egrep... -
dave wanta #2
Re: Shell commands in ASP.NET?
You want to look at the System.Diagnostics.Process namespace.
Cheers!
Dave
[url]www.aspNetEmail.com[/url]
"Allan Rojas" <ndrtkr@thecqgl.com> wrote in message
news:enmRuDYQDHA.4024@tk2msftngp13.phx.gbl...a> Hi,
>
> I want to execute a shell command and retrieve the output of it, is therei> method to do it? All i have found is how to start a process (cmd /C), but> cannot retrieve the result of the command execution.
>
> For example, it would be ideal if there would be a method like:
>
> string result = ExecuteShellCommand("dir *.txt");
>
> thnx in advance...
>
>
>
dave wanta Guest
-
Allan Rojas #3
Re: Shell commands in ASP.NET?
I already did; but when executing the following code, i get a
System.InvalidOperationException: StandardOut has not been redirected.
System.Diagnostics.Process myP = System.Diagnostics.Process.Start("cmd",
@"/C dir C:\");
Response.Output.Write(myP.StandardOutput.ReadToEnd ());
Thnx in advance...
"dave wanta" <nospam@nospam.com> wrote in message
news:O3FSbIYQDHA.560@TK2MSFTNGP10.phx.gbl...there> You want to look at the System.Diagnostics.Process namespace.
>
>
> Cheers!
> Dave
> [url]www.aspNetEmail.com[/url]
>
>
>
> "Allan Rojas" <ndrtkr@thecqgl.com> wrote in message
> news:enmRuDYQDHA.4024@tk2msftngp13.phx.gbl...> > Hi,
> >
> > I want to execute a shell command and retrieve the output of it, isbut> a> > method to do it? All i have found is how to start a process (cmd /C),> i>> > cannot retrieve the result of the command execution.
> >
> > For example, it would be ideal if there would be a method like:
> >
> > string result = ExecuteShellCommand("dir *.txt");
> >
> > thnx in advance...
> >
> >
> >
>
Allan Rojas Guest
-
dave wanta #4
Re: Shell commands in ASP.NET?
you probably need to set
myP.StartInfo.RedirectStandardOutput = true;
btw, if you only want to list out files, i would recommend the System.IO
namespace.
hth,
Dave
[url]www.aspNetEmail.com[/url]
"Allan Rojas" <ndrtkr@thecqgl.com> wrote in message
news:eN4FPSYQDHA.1040@TK2MSFTNGP12.phx.gbl...> I already did; but when executing the following code, i get a
> System.InvalidOperationException: StandardOut has not been redirected.
>
>
> System.Diagnostics.Process myP = System.Diagnostics.Process.Start("cmd",
> @"/C dir C:\");
> Response.Output.Write(myP.StandardOutput.ReadToEnd ());
>
> Thnx in advance...
>
>
> "dave wanta" <nospam@nospam.com> wrote in message
> news:O3FSbIYQDHA.560@TK2MSFTNGP10.phx.gbl...> there> > You want to look at the System.Diagnostics.Process namespace.
> >
> >
> > Cheers!
> > Dave
> > [url]www.aspNetEmail.com[/url]
> >
> >
> >
> > "Allan Rojas" <ndrtkr@thecqgl.com> wrote in message
> > news:enmRuDYQDHA.4024@tk2msftngp13.phx.gbl...> > > Hi,
> > >
> > > I want to execute a shell command and retrieve the output of it, is> but> > a> > > method to do it? All i have found is how to start a process (cmd /C),>> > i> >> > > cannot retrieve the result of the command execution.
> > >
> > > For example, it would be ideal if there would be a method like:
> > >
> > > string result = ExecuteShellCommand("dir *.txt");
> > >
> > > thnx in advance...
> > >
> > >
> > >
> >
>
dave wanta Guest



Reply With Quote

