473,399 Members | 3,888 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,399 software developers and data experts.

Executing DOS commands.... F1 F1 pls...

Hi All,

How can v execute DOS command while executing Console
Application written using C#, like cls,dir commnads.
Thanz in Advance,
Justine
Nov 15 '05 #1
4 8748
Use the Process.Start() method with cmd.exe as the command and /C "command"
as the parameters. This will start a new process, and possible a new console
window, I'm not sure if the command will inherit the current console, so you
may have to write your own code to do this.

Arild

"Justine" <am***********@hotmail.com> wrote in message
news:04****************************@phx.gbl...
Hi All,

How can v execute DOS command while executing Console
Application written using C#, like cls,dir commnads.
Thanz in Advance,
Justine

Nov 15 '05 #2
Hi Arild,

I don't want to start another process as such. Just like
System () Function in C++ which can execute the DOS
command. i would like to have the command executed for as
part of the running console application.
-----Original Message-----
Use the Process.Start() method with cmd.exe as the command and /C "command"as the parameters. This will start a new process, and possible a new consolewindow, I'm not sure if the command will inherit the current console, so youmay have to write your own code to do this.

Arild

"Justine" <am***********@hotmail.com> wrote in message
news:04****************************@phx.gbl...
Hi All,

How can v execute DOS command while executing Console
Application written using C#, like cls,dir commnads.
Thanz in Advance,
Justine

.

Nov 15 '05 #3
That, I'm afraid is not possible... You'd need to create a Process "cmd.exe"
and execute all your DOS commands thru it.

vJ

"Justine" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hi Arild,

I don't want to start another process as such. Just like
System () Function in C++ which can execute the DOS
command. i would like to have the command executed for as
part of the running console application.
-----Original Message-----
Use the Process.Start() method with cmd.exe as the

command and /C "command"
as the parameters. This will start a new process, and

possible a new console
window, I'm not sure if the command will inherit the

current console, so you
may have to write your own code to do this.

Arild

"Justine" <am***********@hotmail.com> wrote in message
news:04****************************@phx.gbl...
Hi All,

How can v execute DOS command while executing Console
Application written using C#, like cls,dir commnads.
Thanz in Advance,
Justine

.

Nov 15 '05 #4
take a look at the start command, something like "start /B cmd.exe /C dir"
should do what you are after.

Willy.
"Justine" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hi Arild,

I don't want to start another process as such. Just like
System () Function in C++ which can execute the DOS
command. i would like to have the command executed for as
part of the running console application.
-----Original Message-----
Use the Process.Start() method with cmd.exe as the

command and /C "command"
as the parameters. This will start a new process, and

possible a new console
window, I'm not sure if the command will inherit the

current console, so you
may have to write your own code to do this.

Arild

"Justine" <am***********@hotmail.com> wrote in message
news:04****************************@phx.gbl...
Hi All,

How can v execute DOS command while executing Console
Application written using C#, like cls,dir commnads.
Thanz in Advance,
Justine

.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Hawkins | last post by:
I seem to remember there's a java function for executing commands on the native system (UNIX in this case) but cannot remember which. Anyone know? Also, is it possible to grab the results of the...
3
by: WIWA | last post by:
Hi all, Anybody that could tell me how to execute some Linux commands using Python. The application is that I want to be able from a website to launch a Python script and that python script...
13
by: Darren Dale | last post by:
Some time ago I asked about executing a python program or script. For windows, I was informed that the .py extension could be added to some list of executable extensions, and then I could just type...
2
by: Pratibha | last post by:
Hi, I want to execute commands through .NET. Using process, i can execute them in WindowsApplication but the process doesn't work in WebApplication. I am executing a batch file which contains...
2
by: Pascal Polleunus | last post by:
(another try with a different subject as it doesn't seem to work with "EXECUTE + transaction = unexpected error -8" :-/) Hi, It seems that there is a problem when executing a dynamic...
2
by: Mark | last post by:
hi, i've written a c++ program that converts one file type to another via two arguments (the input and output filenames). i want to execute this on my server, using something like ...
1
by: natsran | last post by:
Hi All, Is there any perl module which would help in executing commands remotely on a windows machine? For doing the same on unix machine, I found that we could use Net::Telnet module. But...
2
by: SrivalliBapathi | last post by:
Hi, Please help me, if theres a way we can execute DB2 commands directly from the windows cmd prompt window instead of executing those from DB2 CLP window. I need to connect to a DB2 database...
9
by: =?Utf-8?B?UGF1bCBQb2xpY2FycA==?= | last post by:
I'm attempting to make an application that will call and execute multiple "system()" cmd commands simultaneously. The problem is that when the program hits the first system() it waits for it to...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.