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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sandhya20
    New Member
    • Jun 2007
    • 7

    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.Diagnost ics.Process.Sta rt(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
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Which following code?

    Comment

    • sandhya20
      New Member
      • Jun 2007
      • 7

      #3
      try {
      string fileName = Path.Combine(Pa th.GetTempPath( ), attachmentsList .SelectedItems[index].Tag.ToString() );

      System.Diagnost ics.Process.Sta rt(fileName );
      }
      catch (Win32Exception ex) {
      Logger.Write(ex .ToString() );
      }
      eg: i am giving file name as :
      "C:\Documen ts and Settings\Cally Louis\Local Settings\Temp\t mp9414.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.Compone ntModel.Win32Ex ception: The specified executable is not a valid Win32 application.
      at System.Diagnost ics.Process.Sta rtWithCreatePro cess(ProcessSta rtInfo startInfo)
      at System.Diagnost ics.Process.Sta rt()
      at System.Diagnost ics.Process.Sta rt(ProcessStart Info startInfo)

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        The command that you pass to System.Diagnost ics.Process.Sta rt must be a valid command which you can run on the command prompt successfully.

        Comment

        • sandhya20
          New Member
          • Jun 2007
          • 7

          #5
          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

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            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?

            Comment

            Working...