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

Run a program with options

How can i run a program with some options from my windows form??? I have a
fileinfo object with the name of the file...
Nov 16 '05 #1
3 1419
If I understand you correctly, you are trying to execute another program from within your Windows Forms app, and the FileInfo object you are referring to holds the file information for the executable. You should use the System.Diagnostics.Process class. For example, if your FileInfo object were called myFile:

Process myProcess = new Process();
myProcess.StartInfo.FileName = myFile.FullName;
myProcess.StartInfo.Arguments = "<your options go here";
myProcess.Start();

The Process class has a large number of other members you might find useful. I suggest looking it up in the documentation.

--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.

"Ricardo" <r_******@hotmail.com> wrote in message news:ut*************@TK2MSFTNGP12.phx.gbl...
How can i run a program with some options from my windows form??? I have a
fileinfo object with the name of the file...

Nov 16 '05 #2
If I understand you correctly, you are trying to execute another app from within your Windows Forms application, and the FileInfo object you are referring to holds the information for the executable. You should use the System.Diagnostics.Process class. For example, if your FileInfo object were called fi:

Process p = new Process();
p.StartInfo.FileName = fi.FullName;
p.StartInfo.Arguments = "<your options go here>";
p.Start();

The Process class has many other members you might find useful. I suggest looking it up in the documentation.

--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ricardo" <r_******@hotmail.com> wrote in message news:ut*************@TK2MSFTNGP12.phx.gbl...
How can i run a program with some options from my windows form??? I have a
fileinfo object with the name of the file...

Nov 16 '05 #3
thx...
"Kai Brinkmann [MSFT]" <ka******@online.microsoft.com> wrote in message news:Oz**************@tk2msftngp13.phx.gbl...
If I understand you correctly, you are trying to execute another program from within your Windows Forms app, and the FileInfo object you are referring to holds the file information for the executable. You should use the System.Diagnostics.Process class. For example, if your FileInfo object were called myFile:

Process myProcess = new Process();
myProcess.StartInfo.FileName = myFile.FullName;
myProcess.StartInfo.Arguments = "<your options go here";
myProcess.Start();

The Process class has a large number of other members you might find useful. I suggest looking it up in the documentation.

--
Kai Brinkmann [MSFT]

Please do not send e-mail directly to this alias. This alias is for newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.

"Ricardo" <r_******@hotmail.com> wrote in message news:ut*************@TK2MSFTNGP12.phx.gbl...
How can i run a program with some options from my windows form??? I have a
fileinfo object with the name of the file...

Nov 16 '05 #4

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

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
3
by: Ron Stephens | last post by:
I posted to my web site a fun little program called merlin.py today. Please keep in mind that I am a hobbyist and this is just a little hack, if you look at the code you will see that it is still...
2
by: Lazareth S. Link | last post by:
Hiya to whoever might stumble across this. I've recently taken up learning how to script/program in python. I've made my first program, a simple fahrenheit-celsius converter, both ways. For...
1
by: Chris | last post by:
I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed....
2
by: Brian Worth | last post by:
I have just upgraded from VB 4.0 to VB .NET 2002. One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess,...
14
by: electrician | last post by:
While running a program that exceeds the array limits it issues an alert. I want to then stop the program after filling in the output boxes with blanks. How do you stop the program? I have...
7
by: Leo Breebaart | last post by:
I have another question where I am not so much looking for a solution but rather hoping to get some feedback on *which* solutions people here consider good Pythonic ways to approach a issue. ...
8
by: barcaroller | last post by:
Is there a recommended method of parsing program input parameters/options in C++ programs? The three methods that I know of are: - C's getopt() and getopt_long() - GNU C++ GetOpt class -...
0
by: ashishbathini | last post by:
Hi guys here is my problem ... this is the source code I Have , honestly I hav no idea how it works bcos its too complicated for me .... but my problem is ... i hav a freq comonent in it .......
0
by: bvdb | last post by:
Hi Everyone, One of my customers lives in Taiwan and can only make my program work if he changes his Regional and Language Options to English from the Simplifies Chinese that his computer is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.