473,806 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2959
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>interfac e 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.Diagnost ics;

static void Main() {
using (Process proc = Process.Start(" mybatch.bat")) {
proc.WaitForExi t();
if (proc.ExitCode == 0) {
Console.WriteLi ne("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.ed u.for.addresswr ote in message
news:%2******** ********@TK2MSF TNGP02.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.ed u.for.addresswr ote:
>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
2756
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 signalconditions with a Beck industrial PC. Did somebody try this already ? Is there a certain URL where i can get further information.
2
2060
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
1416
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, or even a small program? I have tried an old version of RSAREF (I believe it was v1.0) with TC++ v3.0,
1
5129
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 done? Philip -- esz Elektronik-Service GmbH
24
2020
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 control instead of using the MS Dos Box? And what control can I use for this purpose when I need to have the most similar look to the MS Dos Box? Every help is greatly appreciated.
2
5109
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" rem Open powerpoint into slide show "C:\Program Files\Microsoft Office\OFFICE11\POWERPNT.exe" /s "C:\Documents and Settings\clintad\Desktop\template.ppt"
0
2586
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 out asking user everytime.. I used set PGPASSWORD=my_password.. but this prints password on screen.. due to security issues I dont want to use this. Can some one please guide me is there a way to do this. Thanks in adavance, rao.
7
2465
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 cannot be executed from MSDOS". Please provide feedback on how do I install WINXP through MSDOS OS? Any valuable suggestions would be really helpful!! Thanks!!
1
4121
by: JOHNSHELL08 | last post by:
What is the difference between pc dos & msdos ?
0
9719
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9598
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10623
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10373
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7650
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.