Cannot Open TXT Files - "Session file is either corrupted or not valid"



  • Sudden NPP Behavior Change - Cannot Open TXT Files

    I was working with a new program that allows configuration of the right-click menu in Windows, and suddenly NPP stopped being able to edit a TXT file

    This behavior is not only from a Windows folder, where you can either right-click or double-click to open a TXT file, but NPP will not open or edit files in the Light Explorer window or via Recent Files

    Furthermore, if I eliminate the TXT file extension, NPP will open the file. However, if the extension of TXT is on the file, I get the “Session file is either corrupted or not valid” message

    I rely on NPP for all my TXT file editing, so this is a huge problem. Any assistance will be greatly appreciated

    Michael



  • @MickardEMT

    first thing i would try, is to remove the right click menu tool if possible.

    then try a repair install, using the same npp.7.6.6.installer.exe you used the last time. (i suppose you stayed at 32 bit because of textfx, but i’m not sure)

    if this does not solve the open with or double click on a file for notepad++ yet:

    • close notepad++ if it is open

    • right click on any .txt file and choose open with > choose other app and select notepad++ from this list. (if not available, see farther below)

    • select always use this app to open .txt filesand hit ok.

    • close notepad++ again and retry opening your .txt file by double clicking on it.

    if you are not able to select notepad++.exe form the choose other app list above:

    • close notepad++ if it is open

    • right click on your notepad++ icon and choose “run as administrator”
      (make sure you see [Administrator] at the top bar of your notepad++ window (see screenshot)

    • go to settings > preferences > file association and make sure your needed extensions, like .txt are visible at the registered extensions panel (last panel on the right) as seen on this screenshot:

    Imgur

    • hit close and exit notepad++

    • now reopen notepad++ normally, and go to settings > preferences > file association again, and make sure your needed extensions are also visible for the standard user account.

    • then exit notepad++ again

    • right click on any .txt file and choose open with > choose other app and select notepad++ from this list.

    • select always use this app to open .txt filesand hit ok.

    • close notepad++ again and retry opening your .txt file by e.g. double clicking on it.

    best regards and good luck.



  • Meta Chuh

    As always, your support and replies ROCK!!!

    I will try this shortly and let you know what happens

    Thank you. I will go thru these fixes shortly and report back

    Michael



  • @Meta-Chuh

    Well, I have tried all the steps outlined, and have rebooted the laptop three times. I still cannot get NPP to open a TXT file

    It is still behaving as before, where if the file has no extension, it will open that file. A file with a TXT extension will not open if it is double-clicked, not open if the file is selected from the Light Explorer menu, and will not open if you use the File/Open method

    I did a different type of test and renamed a TXT file as an INI file. NPP opened that file without an error

    I also was able to open an INI file that was generated by another program, and I was able to open a Python file (PY)

    I am thinking it has to do with the Windows context editor I was trying to use. Just not sure how to enable the TXT files again. I am thinking it is a REGISTRY issue

    Michael


Log in to reply