473,624 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling several processes in a dos window

Hi,
here is my trouble:

I need to call 2 différents processes in a same dos window,
the first one is needed for the 2nd, and I have to pass several different
arguments to the 2nd.
My problem is that there are as many dos windows as calls to
"myProcess.star t()", and I don't know how to do ...
Anybody has an idea ?

Thanks in advance (and sorry for my bad English)
Nov 16 '05 #1
7 1822
If I had to guess, you like Unix.

And unfortunately, Windows does not have the equivalent of "&" in Unix.

To get around this, I believe you would have to write code to fire a
process, and free the "Console", so your application is not a Console
application ..

But my answer will be more accurate if I saw your code.

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/

"w.monthard " <mo*******@free .fr> wrote in message
news:40******** *************@n ews.free.fr...
Hi,
here is my trouble:

I need to call 2 différents processes in a same dos window,
the first one is needed for the 2nd, and I have to pass several different
arguments to the 2nd.
My problem is that there are as many dos windows as calls to
"myProcess.star t()", and I don't know how to do ...
Anybody has an idea ?

Thanks in advance (and sorry for my bad English)

Nov 16 '05 #2
My application is a Windows application which has to call a dos application,
but another dos application has to be called before.

Process cmd = new Process();
ProcessStartInf o info = new ProcessStartInf o("cmd");
info.CreateNoWi ndow = false;
info.UseShellEx ecute =false;
info.WorkingDir ectory = aDirectory;
info.Arguments = args;
cmd.StartInfo = info;
cmd.Start();
info.WorkingDir ectory = anotherDirector y;

info.Arguments = otherargs;

cmd.StartInfo = info;

cmd.Start();

This code gives me 2 differents dos windows (2 processes) , and I don't know
how to do to have the same process cmd to execute several times 2
applications with different parameters

"Sahil Malik" <co************ *****@nospam.co m> a écrit dans le message de
news:OS******** ******@TK2MSFTN GP12.phx.gbl...
If I had to guess, you like Unix.

And unfortunately, Windows does not have the equivalent of "&" in Unix.

To get around this, I believe you would have to write code to fire a
process, and free the "Console", so your application is not a Console
application ..

But my answer will be more accurate if I saw your code.

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/

"w.monthard " <mo*******@free .fr> wrote in message
news:40******** *************@n ews.free.fr...
Hi,
here is my trouble:

I need to call 2 différents processes in a same dos window,
the first one is needed for the 2nd, and I have to pass several different
arguments to the 2nd.
My problem is that there are as many dos windows as calls to
"myProcess.star t()", and I don't know how to do ...
Anybody has an idea ?

Thanks in advance (and sorry for my bad English)


Nov 16 '05 #3
monthar,

If 2nd DOS window is receiving the parameters from the 1st, you have then
wait for the 1st one to get completed before entering the 2nd.

To wait, you can do this

pProcess.WaitFo rExit();

Have i understood your question correctly?
Shak.
"w.monthard " <mo*******@free .fr> wrote in message
news:40******** *************@n ews.free.fr...
Hi,
here is my trouble:

I need to call 2 différents processes in a same dos window,
the first one is needed for the 2nd, and I have to pass several different
arguments to the 2nd.
My problem is that there are as many dos windows as calls to
"myProcess.star t()", and I don't know how to do ...
Anybody has an idea ?

Thanks in advance (and sorry for my bad English)

Nov 16 '05 #4
Hi,

If you need to simply start a new process and get the output printed
onto the same console window, the following code would probably serve
the purpose:

---=== Code begins ===---

System.Diagnost ics.Process myProcess = new
System.Diagnost ics.Process();
string myFileName = "c:\file.ex e";
string myArguments = " /1 /2 /3";

myProcess .StartInfo.File Name = myFileName;
myProcess .StartInfo.Argu ments = myArguments;
myProcess .StartInfo.Redi rectStandardOut put = true;
myProcess .StartInfo.UseS hellExecute = false;
myProcess .StartInfo.Crea teNoWindow = true;
myProcess .Start();
string output = myProcess .StandardOutput .ReadToEnd();
myProcess .WaitForExit();

Console.WriteLi ne(output);

---=== End of Code ===---

The code (process 1) spawns a new process without creating a new
window for it. Process 1 then waits for process 2 to quit, reads
whatever process 2 has output to the console and then prints it to
process 1's console.

Hope that helps. :)

"w.monthard " <mo*******@free .fr> wrote in message news:<40******* **************@ news.free.fr>.. .
Hi,
here is my trouble:

I need to call 2 différents processes in a same dos window,
the first one is needed for the 2nd, and I have to pass several different
arguments to the 2nd.
My problem is that there are as many dos windows as calls to
"myProcess.star t()", and I don't know how to do ...
Anybody has an idea ?

Thanks in advance (and sorry for my bad English)

Nov 16 '05 #5
The 2nd process does not wait for the 1st process :
1. the 1st process is executed in a dos window, if it is not executed
before, the 2nd process produces nothing; it has to be executed in his
directory.
2. the 2nd process is executed with parameters in the SAME dos window, in
another directory (in a different dos window, it produces nothing), it
receives about 100 different parameters sent in a boucle "for".

My problem is to execute these 2 different processes in the same dos
windows,
I could create a batch file which executes these 2 different processes and
execute it 100 times but I try to find another solution.
Nov 16 '05 #6
write a batch file to the directory you need to execute the apps in. The
batch file will contain the commands to execute both processes.
Then, from .NET, start the batch file.

--- Nick

"w.monthard " <mo*******@free .fr> wrote in message
news:40******** *************@n ews.free.fr...
The 2nd process does not wait for the 1st process :
1. the 1st process is executed in a dos window, if it is not executed
before, the 2nd process produces nothing; it has to be executed in his
directory.
2. the 2nd process is executed with parameters in the SAME dos window, in
another directory (in a different dos window, it produces nothing), it
receives about 100 different parameters sent in a boucle "for".

My problem is to execute these 2 different processes in the same dos
windows,
I could create a batch file which executes these 2 different processes and
execute it 100 times but I try to find another solution.

Nov 16 '05 #7
I'll try this solution if I don't find another solution.
Thanks

"Nick Malik" <ni*******@hotm ail.nospam.com> a écrit dans le message de
news:T8LAc.6506 2$eu.49473@attb i_s02...
write a batch file to the directory you need to execute the apps in. The
batch file will contain the commands to execute both processes.
Then, from .NET, start the batch file.

--- Nick
Nov 16 '05 #8

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

Similar topics

11
3698
by: juglesh | last post by:
at one centraldomain.com, I have central.php, which consists of this: <?php function square($num) { return $num * $num; } ?> at outerdomain.com, I have test.php, which consists of this: <?php include "http://www.centraldomain.com/central.php";
8
2410
by: Matthew Bell | last post by:
Hi, I've got a question about whether there are any issues with directly calling attributes and/or methods of a threaded class instance. I wonder if someone could give me some advice on this. Generally, the documentation suggests that queues or similar constructs should be used for thread inter-process comms. I've had a lot of success in doing that (generally by passing in the queue during the __init__ of the thread) and I can see...
3
1514
by: w.monthard | last post by:
Hi, here is my trouble: I need to call 2 différents processes in a same dos window, the first one is needed for the 2nd, and I have to pass several different arguments to the 2nd. My problem is that there are as many dos windows as calls to "myProcess.start()", and I don't know how to do ... Anybody has an idea ?
2
4547
by: Randell D. | last post by:
Folks, I have got this working before, in part with some help from this ng but I never really understood how I got it working... and last time, I was using it via a popup window as opposed to an IFRAME. I've got several months of javascript under my belt and can resolve most things without errors in my Mozilla Javascript Console, but this one just does not do it for me. This is the picture:
21
3576
by: Joakim Hove | last post by:
Hello, I have implemented a small library with a function a datatype to manage temporary storage, and handle out correctly casted storage. The function to get a double pointer is for instance: double * work_get_double(work_type *work, size_t size) {} Now, if the work area is not sufficiently large, the function fails,
6
2162
by: Fernando Cacciola | last post by:
Calling C# from unmanaged C++: Is there any way to do this without COM? I have an unmanaged processing class and "all I want" is a way to give progress feedback into the C# client code. I basically just need to call an "Inc()" method into some managed progress bar (And to consult a "IsUserAborted" too)
4
2161
by: Mike Youell | last post by:
Hi, I am trying to call an application from php. I have tried exec() and system() and even popen() all to no avail. Can an application be called if it brings up a window? The app I am calling has a command line interface, but it insists on bringing up it's standard window also.
12
4987
by: Sune | last post by:
Hi all, I want to make data stored in-memory (not disk) available to several processes. My concern is that poorly written C applications with dangling pointers may(will) damage the data in this memory segment if it is open to all, i.e. shared memory mapped into all processes memory area. I don't want to use TCP/IP client/server between the apps and a data store process due to the overhead.
0
13317
amitpatel66
by: amitpatel66 | last post by:
There is always a requirement that in Oracle Applications, the Concurrent Program need to be execute programatically based on certain conditions/validations: Concurrent programs can be executed programatically either from UNIX or Oracle PLSQL. In this Section, I will be explaining about calling a Concurrent program from UNIX using the CONCSUB Command. Pre-requisite: 1. Concurrent Program should be registered in oracle Applications...
0
8173
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
8679
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
8621
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
8335
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,...
0
8475
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
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
4079
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.