Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 82789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T21:40:19+00:00 2026-05-10T21:40:19+00:00

I have a command-line process I would like to automate and capture in C#.

  • 0

I have a command-line process I would like to automate and capture in C#.

At the command line, I type:

nslookup 

This launches a shell which gives me a > prompt. At the prompt, I then type:

ls -a mydomain.local 

This returns a list of local CNAMEs from my primary DNS server and the physical machines they are attached to.

What I would like to do is automate this process from C#. If this were a simple command, I would just use Process.StartInfo.RedirectStandardOutput = true, but the requirement of a second step is tripping me up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T21:40:20+00:00Added an answer on May 10, 2026 at 9:40 pm
    ProcessStartInfo si = new ProcessStartInfo('nslookup'); si.RedirectStandardInput = true; si.RedirectStandardOutput = true; Process nslookup = new Process(si); nslookup.Start(); nslookup.StandardInput.WriteLine('ls -a mydomain.local'); nslookup.StandardInput.Flush(); // use nslookup.StandardOutput stream to read the result.  
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to develop a command-line program that can process and give help
I have some command-line ruby scripts for things like pre-processing text files before uploading
Say I have a command line C program which is currently executing, and I
I have written a command-line tool that uses sub-commands much like Mercurial, Git, Subversion
I have this sql script that I would like to execute in a java
I would like to debug my C++ application. It takes a few command line
:) I have a software which can be executed via command line, and now
I have a process that modifies some files and I would like to commit
For security reasons (I'm a developer) I do not have command line access to
I have a command line script that uses the Django ORM and MySQL backend.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.