473,404 Members | 2,137 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,404 software developers and data experts.

I use msdos in C# ???

I want working some msdos command with C#. I want works this codes in
C#. If click buton1 before start cmd after working this code after
close cmd.

How to build this code in C# ?

netsh>pushd

netsh>interface ip

netsh interface ip>set address local static 10.0.0.9 255.0.0.0 10.0.0.1
1

netsh interface ip>popd
Sorry, my english bad :(

Jan 20 '07 #1
4 2935
On 20 Jan 2007 14:50:24 -0800, "totleben" <mu******@gmail.comwrote:
>I want working some msdos command with C#. I want works this codes in
C#. If click buton1 before start cmd after working this code after
close cmd.

How to build this code in C# ?

netsh>pushd

netsh>interface ip

netsh interface ip>set address local static 10.0.0.9 255.0.0.0 10.0.0.1
1

netsh interface ip>popd
Sorry, my english bad :(
Write your MSDOS comands into a batch file. Fire the batch file from
within a C# process.

-- mybatch.bat ----

echo "Hello World!"
pause
-- C# --

using System.Diagnostics;

static void Main() {
using (Process proc = Process.Start("mybatch.bat")) {
proc.WaitForExit();
if (proc.ExitCode == 0) {
Console.WriteLine("Finished OK");
}
}
}

Your English is a lot better than my German (?)

rossum
Jan 21 '07 #2
Everyone please note that the Windows command prompt is not MS-DOS.
Jan 22 '07 #3
"Michael A. Covington" <lo**@ai.uga.edu.for.addresswrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Everyone please note that the Windows command prompt is not MS-DOS.
Absolutely!
Jan 22 '07 #4
On Sun, 21 Jan 2007 20:09:25 -0500, "Michael A. Covington"
<lo**@ai.uga.edu.for.addresswrote:
>Everyone please note that the Windows command prompt is not MS-DOS.
Correct, however it is the closest that the OP is likely to get this
side of a version of Mono for MSDOS.

rossum

Jan 22 '07 #5

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

Similar topics

5
by: Manfred Schwab | last post by:
Hi there, which versions of python are usable under MS-DOS 5.0 oder 6.22 or Dr. DOS. I want to use it under a industrial environment to collect measuring data like temperature, moist and...
2
by: bithead | last post by:
How do you invoke a MSDOS program from C#.net program? system("dir"), shell("dir") don't work. What else is there?
3
by: Crypto Loko | last post by:
Hello everyone, I was wondering if anyone should have any TC++ v3.0 / BC++ v3.1, or DJGPP v2.03 code for RSA implementation (or similar public-key scheme(s)) - of either a module, a library,...
1
by: Philip M. Fleischmann | last post by:
Hi, i have to convert raw MSDOS-OEM-character set text files (codepage 430) to standard windows ANSI character set for file I/O in C# (batch conversion). Can anyone help me how this can be...
24
by: tizi_de | last post by:
Hello all, I'm looking for a sample program in C to print out lines not to the standard MS Dos Box but into a different control e.g. text control. Has C the possibility to do printouts to a...
2
by: dac9901 | last post by:
Hi Everyone, I have a batch file that opens several programs as shown below: *********** rem Open Desktop Weather "C:\Program Files\The Weather Channel FW\Desktop Weather\DesktopWeather.exe"...
0
by: rao123 | last post by:
Hi, I want to execute some set of Postgres routines like psql,pg_dump,pg_restore in a single MSDos batch file. I want to prompt user only once for password and use that in entire batch file with...
7
amitpatel66
by: amitpatel66 | last post by:
Hi, I have formatted my C: drive in which WIN98 was installed. I have a bootable floppy and I booted my machine using this floppy. When I run SETUP (EXE) from WINXP CD, it says: "The SETUP...
1
by: JOHNSHELL08 | last post by:
What is the difference between pc dos & msdos ?
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: 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
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...
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.