473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

run command prompt

344 100+
Hi

I'm trying to run a simple command prompt "help". But the command prompt opens and no command runs!

Expand|Select|Wrap|Line Numbers
  1. string strCmdText;
  2. strCmdText = "help";
  3. System.Diagnostics.Process.Start("CMD.exe", strCmdText);
  4.  
I appreciate your help.
Mar 28 '13 #1
2 1408
r035198x
13,262 8TB
Try using ProcessStartInfo and redirecting the output of the process to the console so you can see what's going on.
Mar 29 '13 #2
Bassem
344 100+
Thank you r035198x. But I wanted to run a regular console window that users can interact with from outside my application.

I found that sending a command as an argument to "cmd.exe" does not mean that it should execute it. We have to lead the command with one of these instructions:

/c means execute then terminate.
/k means execute and wait for a user input.
Mar 29 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: msuk | last post by:
All, I am trying to use Regasm from the command prompt and have to keep putting the full file path of where my assembley is located. Does anyone know how to set it up so wherever I run the...
3
by: Rog | last post by:
Yes, I am guessing that typing cmd in the run windows will bring up the command prompt, but not the vs.net command prompt. Is there a switch(s) for accessing the vs.net command prompt? Or...
4
by: glenn | last post by:
I keep reading all sorts of books on VS that keep telling me to click on Tools/Visual Studio Command prompt to run this program or that program. However, I do not have such a menu choice. Where is...
4
by: Thomas Johnson | last post by:
I am trying to find out how to access the VS 2003 .Net command prompt. I am trying to execute the 'csc' command against a module but have no idea where to find the command prompt. Here's a stupid...
1
by: Jay Feldman | last post by:
I've seen some messages about the screen flashing black for a few moments when executing a program in vb.net this may be because the command prompt settings were changed. when the command prompt...
6
by: Jwolf | last post by:
I have .net 2002 edu version and when it installed there was a shortcut to the .net command prompt. My CLR disk is scratched so I can't reinstall and so I just downloaded express. I dont know...
11
by: gert365 | last post by:
I'm working on a scirpt to be used on a windows machine and I need to automate a user's input on the command prompt. For example I'm using os.system('mycommand') to excute the commands I want. ...
6
by: Shooter4Life8 | last post by:
Hi, I am having trouble figureing out the best way to open a command prompt then write lines to it in VB.NET. Currently I have this code, but it execute's too fast I think because Dim psi As...
4
by: =?Utf-8?B?WUlndWNoaQ==?= | last post by:
Hi , I want to run a batch file from the c# code. Every time i run the batch file command prompt is displayed. I do not want to show this command prompt. Is there any way to suppress the...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.