469,282 Members | 2,373 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

No application is associated with the specified file for this operation.

Hi,
the following code is working fine when i am running the application.exe file.
System.Diagnostics.Process.Start(filename);
But when i am opening it by using "Run As" option & giving user name & pwd it is throwing exception
No application is associated with the specified file for this operation.
plz help me out
Nov 7 '08 #1
5 12980
r035198x
13,262 8TB
Which following code?
Nov 7 '08 #2
try {
string fileName = Path.Combine(Path.GetTempPath(), attachmentsList.SelectedItems[index].Tag.ToString());

System.Diagnostics.Process.Start(fileName );
}
catch (Win32Exception ex) {
Logger.Write(ex.ToString() );
}
eg: i am giving file name as :
"C:\Documents and Settings\Cally Louis\Local Settings\Temp\tmp9414.gif"
in both cases

there is list view in my application which contains list of Icons on double clicking on those icons(bmp/jpg) that file is getting opened directly.
when i run my application using run as option that same file , it is throwing exception

11/6/2008 6:26:25 PM : 84 ms :System.ComponentModel.Win32Exception: The specified executable is not a valid Win32 application.
at System.Diagnostics.Process.StartWithCreateProcess( ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
Nov 7 '08 #3
r035198x
13,262 8TB
The command that you pass to System.Diagnostics.Process.Start must be a valid command which you can run on the command prompt successfully.
Nov 7 '08 #4
thanq,
but the file name which i am specifying is working fine when i run directly .exe file
but when i am right clicking on that .exe file i have run - as option then double clicking on that icon same file is not getting displayed it is throwing the above mentioned exception
Nov 7 '08 #5
Plater
7,872 Expert 4TB
Running non-binary files (like .GIF) relies on the shell configuration in the registry. Is it possible for the user you are providing, there is no default handler for those file types?
Nov 7 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Jason Charalambides | last post: by
2 posts views Thread by Phil Galey | last post: by
3 posts views Thread by VooDoo | last post: by
reply views Thread by John Jenkins | last post: by
reply views Thread by Bishoy George | last post: by
40 posts views Thread by =?Utf-8?B?Um9iZXJ0IEUuIEZsYWhlcnR5?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.