Click here to Skip to main content
16,021,285 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
When I write
"C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe C:\Users\trainee7\Desktop\notepads\ec2.txt"
in my cmd it will execute.
"C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe" is for open notepad files.
but my
C#
Process.Start(@"C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe C:\Users\trainee7\Desktop\notepads\ec2.txt");

arise filenotexception
How can solve it?
Posted
Updated 22-Jan-13 2:00am
v2

1 solution

Try:
C#
Process.Start(@"C:\Users\trainee7\Desktop\ConsoleApplication2\ConsoleApplication2\bin\Debug\ConsoleApplication2.exe", 
              @"C:\Users\trainee7\Desktop\notepads\ec2.txt");
 
Share this answer
 
Comments
gavkk 22-Jan-13 8:02am    
It's worked.
Thanks
OriginalGriff 22-Jan-13 8:05am    
You're welcome!
Sergey Alexandrovich Kryukov 22-Jan-13 11:09am    
Good catch, a 5.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900