LaunchFileAsync Does Not launch an Application to load a CSV File


  • Hello there

    I am unable to launch an application to load a CSV file using LaunchFileAsync().

    I have a JavaScript based Windows Store application, which creates a .csv file to a location seleted by the user using a File Picker.  This works when I create a .txt file (with identical content), and also for another .htm file that I create.  However, when I create a .csv file, the LaunchFileAsync() simply returns false and no application is started.  I have associated both .csv and .txt files to be opened using NotePad, and I can successfuly open the .csv file in Notepad by double clicking on it from Explorer.

    I have seen a vague reference to not all file types being supported with LaunchFileAsync(), however I have not found where this is properly documented, nor indeed can I work out how to obtain a proper error response from LaunchFileAsync().

    .csv files were being successfully opened before I "upgraded" from Windows Release Preview to Windows RTM (and to Visual Studio Express 2012).  I successfully opened the .csv file the very first time that I ran it after installing Windows RTM, however it has failed every time since.

    Any assistance would be appreciated.

    Geoff Olding

    Monday, September 17, 2012 7:55 PM

All replies

  • I can't reproduce this using the following code (cut & pasted from the LaunchFileAsync documentation):

        function button1_click() {
            // Path to the file in the app package to launch
            var csvFile = "testfile.csv";
            // Get the image file from the package's image directory
              function (file) {
                  // Launch the retrieved file using the default app
                    function (success) {
                        if (success) {
                            // File launched
                        } else {
                            // File launch failed

    If you don't have a csv handler registered then you should get a dialog asking you to find one. Since you do, it should open in Notepad. Are you getting any exceptions when you try to perform the launch? Where does the csv file come from? Are you successfully loading it into your StorageFile?

    The limitation on file types supported is for types which can contain executable code. See the Remarks in the LaunchFileAsync documentation for details.


    Thursday, September 20, 2012 2:09 AM
  • Hello there

    I am not getting any exceptions.  The call to Windows.Systems.Launcher.laucnhFileAsync() returns false - it goes into the bit of code marked // File launch failed.

    The code creates the csv file, and immediately tries to launch the associated application to display it.  However, I have also tried launching the associated application with an existing csv file selected by the user, and I get the same problem.  It is being successfully loaded into my StorageFile.


    Geoff Olding

    Thursday, September 20, 2012 9:04 PM
  • maybe the same Bug?


    Monday, April 08, 2013 9:19 PM