473,396 Members | 1,996 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,396 software developers and data experts.

How do I run DOS Applications from a C# program

I want to run a DOS application from my C# program. The DOS application takes
in some command line arguments. I've tried everything but for some reason I
can't get it to work. PLEASE HELP!

Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "c:\\cabarc.exe";
p.StartInfo.Arguments = "x c:\test.cab c:\test.xml";
bool result = p.Start();

I get result = true but the cab file is not decompressed into the test.xml
file.

When I run cabarc.exe x test.cab test.xml from the command prompt,
everything works fine.
Nov 16 '05 #1
1 5397
"Muneeb" <Mu****@discussions.microsoft.com> wrote in message
news:69**********************************@microsof t.com...
p.StartInfo.FileName = "c:\\cabarc.exe";
p.StartInfo.Arguments = "x c:\test.cab c:\test.xml";


Note the difference between these two lines - in the first you're correctly
using "\\" to tell C# that you mean the backslash character, but in the
second C# will understand the source filename as "c:<TAB>est.cab". Therefore
change the second line above to either:

p.StartInfo.Arguments = "x c:\\test.cab c:\\test.xml";

or

p.StartInfo.Arguments = @"x c:\test.cab c:\test.xml";
Nov 16 '05 #2

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

Similar topics

0
by: Constandinos Mavromoustakis | last post by:
CFP: CLADE 2004-Challenges of Large Applications in Distributed Environments ------------------------------------------------- PhD student - Dept.Informatics at Aristotle University of...
2
by: Jim | last post by:
Can someone please explain the difference between Static Qt Applications and Dynamic Qt Applications? The Trolltech documentation only says that for Dynamic Qt Applications you need either qt.dll...
0
by: RDJ | last post by:
http://spazioinwind.libero.it/rdjhome/BrowAppSys-0.0.1.zip === This is a AoooAoooA project (^_^) === BrowAppSys (BAS): Browser Applications System V.0.0.1 (2004 Oct 16) Copyright (C) 2004...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
0
by: vcp | last post by:
<xml newbie> Hi all, We are considering using XML to specify rules, policies. This XML file will be used to generate source code in either managed C++ or C#, which will be implemention of API...
2
by: Mike Ridley | last post by:
I have a database of Access tables on the server and ODBC links to legacy systems. This is not too much of a problem as, at least, I have my tables/files in 2 distinct places. Unfortunately as...
54
by: Matt | last post by:
How do we define systems programs? when we say systems programming, does it necessary mean that the programs we write need to interact with hardware directly? For example, OS, compiler, kernel,...
2
by: Alper AKCAYOZ | last post by:
Hello, I have developped an application used by Windows Forms (.NET) at Visual C++ ..NET v2003. I would like to limit my application to one instance working at a moment. More than one working...
4
by: Robert Samuel White | last post by:
Hi there. Can anyone point me to some good references or examples on how to create an independent tray program that can send triggers to external applications all designed inside the same...
3
by: joannax | last post by:
Hi, I am an experienced programmer in several languages, but new to VB .NET. I am designing an application which consists of a single "menu" program/form that selectively transfers control to...
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: 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
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
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...
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...

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.