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

Process.StartInfo

After using a OpenFileDialog to locate a file within
Visual Studio.Net, A System.Diagnostics.Process is created
and the file information set using StartInfo. The process
returns an error indicating the File cannot be found
although the file is available and the working directory
has been set. If the OpenFileDialog is not used and the
path to the file is set directly the process is started
and works fine. This is repeatable and fails every time.
It appears to be a bug. Any suggestions would be
appreciated.
Jul 19 '05 #1
2 3507
Hi Richard,

The following code worked for me:

OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();

ProcessStartInfo startInfo = new ProcessStartInfo(ofd.FileName);
Process proc = Process.Start(startInfo);

proc.WaitForExit();

This allowed me to select a file using the Open File dialog, and then it
correctly launched the process. Could you post the snippet of code that
you're using, which is causing a problem?

Thanks,
Rajeev
Visual Studio .NET
Microsoft Corp.

This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 19 '05 #2
Thanks for the reply,

The exact same code does not work on my machine. If I do the
ProcessStartInfo without doing the OpenFileDialog first (hard coding the
path), it works. I'm using .Net Framework v1.0.3705

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

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

Similar topics

2
by: Michael Smith | last post by:
Hi, I am using the following code to print documents directly to the default printer ************** ProcessStartInfo startInfo = new ProcessStartInfo ("<someprogram>.exe");...
5
by: ask | last post by:
Hi NG I'm a bit new to programming c# and have a question regarding ftp by the command prompt. As far as I can see it should be possible to start a process and pipe command streams into it. But...
4
by: Yiu | last post by:
upgent help i want to start IE explorer using C# i try many code such as below: ProcessStartInfo startInfo = new ProcessStartInfo("IEXPLORE.EXE"); Process.Start(startInfo); or Process...
4
by: jam | last post by:
Dear All, I have a command process running xcopy in console, and now I want to execute the program Rsync After the files are copied...how could i do?? Process p10=new Process();...
7
by: Samantha | last post by:
Hello , I am developping a program for Win98 plateform, and I am stucking with a problem, hope you can help me. I have a program running 2 process : - One process running the Xcopy.exe -...
2
by: Brian | last post by:
I'm running a dos program via System.Diagnostics.Process. The dos program is very picky about filenames and such, and so I want to show the output to the user so they can verify it did what it...
2
by: Alexander van Doormalen | last post by:
I am trying to run an external process (command tool) within a Windows Service with the specified account. When the application launches I get a error dialog with the following message: ...
1
by: =?Utf-8?B?UmF5IE1pdGNoZWxs?= | last post by:
Hello, I have a C# application in which I start another process which produces output to stdout and stderr. In fact, that process is the uSoft VS2005 C/C++ compiler itself! I would like to...
1
by: Rick | last post by:
Can anyone tell me how to set the printer using the process class in VB.net, I've tried everything, it always goes to the default printer. My Code: Dim pathToExecutable As String =...
4
by: =?Utf-8?B?SHVleQ==?= | last post by:
I need to hide the new window started from the code below. If I run as is, the window is visible. If I comment out the code that sets a different user, domain, and password the window is hidden...
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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...

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.