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 7713619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:55:03+00:00 2026-06-01T01:55:03+00:00

I try to launch the command prompt hidden when querying the wmic qfe list

  • 0

I try to launch the command prompt hidden when querying the wmic qfe list that contains my installed KB articles.

I launch the command “wmic qfe list full” from inside my command prompt and this gets me the list.

When I do this from inside my C# app, in order to let my process execution from cmd.Exe stop after the command has completed, i use the /c switch as an argument. However, since I added this switch, I can no longer have my cmd.exe launching hidden.

It pops up and executes the code and as it should do, it closes itself after execution of the command and it pipes the information to my app.

But I cannot hide it. Any advise on hiding it with the /c switch in the arguments or having it stop after the command line has been executed without the /c switch in it.

Here is my code:

private void btn_Click(object sender, EventArgs e)
{
    string fileName = @"cmd.exe";

    Process p = new Process();

    ProcessStartInfo ps = new ProcessStartInfo();
    ps.Arguments = " /c wmic qfe list full";
    ps.FileName = fileName;
    ps.UseShellExecute = false;
    ps.WindowStyle = ProcessWindowStyle.Hidden;
    ps.RedirectStandardInput = true;
    ps.RedirectStandardOutput = true;
    ps.RedirectStandardError = true;

    p.StartInfo = ps;
    p.Start();

    StreamReader srrOutput = p.StandardOutput;

    this.textBox1.Text = srrOutput.ReadToEnd();

}

Found it, apparently adding the /C switch also requires me to add:

    ps.CreateNoWindow = true;

Now it works just fine, Should’ve googled somewhat longer..

  • 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. Editorial Team
    Editorial Team
    2026-06-01T01:55:05+00:00Added an answer on June 1, 2026 at 1:55 am

    I had the same issue as well when trying to use /c in cmd.
    You have to use:

        ps.CreateNoWindow = true; 
    

    Without the /c command, the

        ps.WindowStyle = ProcessWindowStyle.Hidden;  
    

    Same issue with the /k switch.

    Regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have wanted to try GAE since launch, but coming from ASP .NET and
I try to start plink.exe (PuTTY Link, the command line utility/version of PuTTY) from
On linux, I often launch and compile from the command line (java/javac) Though, Java
When ever I try to launch my eclipse I am getting the following exception
I have the following code to launch a file : try { path =
When I try to run Azure sdk, it throws me an error Cannot launch
I've just get a new machine and try to checkout, build and launch my
I am trying to execute unix command using SSH from cygwin. My set of
I have a process that needs to launch a child process and communicate with
I am trying to run a command java -jar ccu-historian.jar as launch item When

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.