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

Executing DOS commands from with my application

Hi I want my VB.NET application to run a command from the command line and then wait for the command to finish before continuing.

I am currently using

System.Diagnostics.Process.Start(strApp)

where strApp is the the command line text.

However this method starts a new process and therefore my application continues without waiting.

Any ideas?
Jul 21 '05 #1
2 2153
hplloyd <hp*****@discussions.microsoft.com> wrote:
Hi I want my VB.NET application to run a command from the command
line and then wait for the command to finish before continuing.

I am currently using

System.Diagnostics.Process.Start(strApp)

where strApp is the the command line text.

However this method starts a new process and therefore my application
continues without waiting.

Any ideas?


Process.Start returns a Process reference. Use Process.WaitForExit to
wait for that process to complete.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
You can use Process.WaitForExit, supplying an interval in milliseconds if you are concerned the process could hang.

Dan

"hplloyd" wrote:
Hi I want my VB.NET application to run a command from the command line and then wait for the command to finish before continuing.

I am currently using

System.Diagnostics.Process.Start(strApp)

where strApp is the the command line text.

However this method starts a new process and therefore my application continues without waiting.

Any ideas?

Jul 21 '05 #3

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...
4
by: Justine | last post by:
Hi All, How can v execute DOS command while executing Console Application written using C#, like cls,dir commnads. Thanz in Advance, Justine
2
by: Jas Manghera | last post by:
Hello everyone, Im having a rather strange problem with my custom ASP.NET application. After deploying the application on a .NET v1.1 computer, the first time the application is launched it can...
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: yogee | last post by:
How to get right click menu of a file and execute the commands from my vb ..net application. Minimally, I want to handle the image files with commands like "open" and "open with". More Scenario...
0
by: Bruceneedshelp | last post by:
My application starts logging and executes shell commands on startup. The application runs fine, except when it executes at boot time. In other words when I make it a "startup" application on my...
3
by: andersond | last post by:
I have a website application that provides online quotes for insurance. I want the application to send an email to the agent when they have requested binding AND execute a branch to the next CGI...
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...
2
by: iheartvba | last post by:
Hi, I have an application which I would like to firstly open Automatically, and secondly after the application has opened it should execute certain commands within the opened application...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
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...

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.