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

  • Home
  • SEARCH
  • 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 7566297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:22:37+00:00 2026-05-30T14:22:37+00:00

I am new to c# programing.I want function like int system(command string) of c++

  • 0

I am new to c# programing.I want function like int system(“command string”) of c++ in c#.

for example: we can execute command on command prompt by using function system("winrm") in c++ where “winrm” is command. system() functon is in stdlib.h header file.
I want to know whether this kind of function is available in c#. if yes let me know.
Or can i use same system() method in c#? if yes,then tell me how to use?
Thank you !!

  • 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-05-30T14:22:38+00:00Added an answer on May 30, 2026 at 2:22 pm

    Seams that you are looking for Process Class. Info from MSDN:

    Provides access to local and remote processes and enables you to start and stop local system processes.

    using System;
    using System.Diagnostics;
    using System.ComponentModel;
    
    namespace MyProcessSample
    {
        class MyProcess
        {
            public static void Main()
            {
                Process myProcess = new Process();
    
                try
                {
                    myProcess.StartInfo.UseShellExecute = false;
                    // You can start any process, HelloWorld is a do-nothing example.
                    myProcess.StartInfo.FileName = "C:\\HelloWorld.exe";
                    myProcess.StartInfo.CreateNoWindow = true;
                    myProcess.Start();
                    // This code assumes the process you are starting will terminate itself. 
                    // Given that is is started without a window so you cannot terminate it 
                    // on the desktop, it must terminate itself or you can do it programmatically
                    // from this application using the Kill method.
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }
            }
        }
    }
    

    Added after comment.

    The simplest way to execute command probably is static method Start(String) of Process class or the other one Start(String, String) that executes application with arguments.

    Process.Start("application.exe");
    

    or

    Process.Start("application.exe", "param1 param2");
    

    The above example gives you more flexibility. E.g. using ProcessStartInfo Class as a parameter to Start method that can redirect an input or output for console applications.

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

Sidebar

Related Questions

I am new to programming. I have lots of interest in networking and want
I'm new to Flex, although not new to programming. I want to write a
i'm new at C Programming (i learned c++) i want to create a process
I'm relatively new to .NET programming (and OOP in general) and I want to
I am new to iPhone programming. I want to get the height and width
I am very new to C++ programming and you will see why. I want
I am new to C# and .NET programming. I want to design an application
i got a new programing book (multicore programming by cameron hughes, tracey hughes). so
(I'm a mac user) I'm new at this whole programing thing. its been explained
I want to write a function that reads a file and counts the number

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.