D
djc
I'm wondering what options are available, if any, for being able to run 'any
command line command' from a .net compiled program. I would want the output
that would normally go to the command line for the command to be available
to my program.
I know from even very old VB that you can 'shell' out and run programs, one
of which could be for example, cmd.exe with specific command but I don't
know that you could get the actual command results (other than an exit, or
return code). Plus, before I go 'shelling out' I wanted to see if there is a
'newer' way of doing this. Maybe something more builtin like a class that
actually exposes an interface to send standard shell commands to and returns
the results to you in code? The actual output that would appear on the
screen if you had run the command from the command line.
eg.
myVariable = SomeCoolClass.ExecShellCmd("dir c:")
and the directory listing for c: would be a string in myVariable (including
white space chars to preserve formatting)
anyone know of anything like this? Buitlin to .net already?
command line command' from a .net compiled program. I would want the output
that would normally go to the command line for the command to be available
to my program.
I know from even very old VB that you can 'shell' out and run programs, one
of which could be for example, cmd.exe with specific command but I don't
know that you could get the actual command results (other than an exit, or
return code). Plus, before I go 'shelling out' I wanted to see if there is a
'newer' way of doing this. Maybe something more builtin like a class that
actually exposes an interface to send standard shell commands to and returns
the results to you in code? The actual output that would appear on the
screen if you had run the command from the command line.
eg.
myVariable = SomeCoolClass.ExecShellCmd("dir c:")
and the directory listing for c: would be a string in myVariable (including
white space chars to preserve formatting)
anyone know of anything like this? Buitlin to .net already?