Starting a process with a non default application  
Author Message
Deming





PostPosted: Visual C# Express Edition, Starting a process with a non default application Top

System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo( );

System.Diagnostics.Process.Start(psi);

This works fine if I want to open the file with notepad. How do I open this with another application, such as wordpad, or word



Visual Studio Express Editions7  
 
 
nobugz





PostPosted: Visual C# Express Edition, Starting a process with a non default application Top






 
 
Deming





PostPosted: Visual C# Express Edition, Starting a process with a non default application Top

I get a "The system cannot find the file specified" message with this code. what am I missing
 
 
nobugz





PostPosted: Visual C# Express Edition, Starting a process with a non default application Top

Try using the full pathname of the executable:
C:\Program Files\Windows NT\Accessories\Wordpad.exe
C:\Program Files\Microsoft Office\Office11\WinWord.exe

These names depend on the Windows and Office versions you have. Search your C: drive if it still doesn't work.



 
 
Deming





PostPosted: Visual C# Express Edition, Starting a process with a non default application Top

After a lot of searching and expermentation, what needs to be done is this.

FilePath is the name of what process you wish to open the file, FileName is the name of the file one wishes to open. If the COMMA is not there it will flag an error.