I need to execute the following command in Visual Studio:
dsquery group -name "groupname" |dsget group -members
This works fine in command prompt, but doesn't give any output in Visual Studio. I am using following code snippet.
private void button1_Click(object sender, EventArgs e)
{
string groupname =" " + "group" + " " + "-name" + " " + search_box.Text+"dsget"+" "+"group"+" "+"-members";
ProcessStartInfo psi = new ProcessStartInfo("dsquery", groupname);
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.CreateNoWindow = true;
var proc = Process.Start(psi);
string s = proc.StandardOutput.ReadToEnd();
textBox1.Text = s;
}
Please let me know what is wrong with this code?