Community
    • Login

    NPP will open file with one extension, but not another for same content

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 820 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Paul HutsonP
      Paul Hutson
      last edited by

      I am running Win10 and have recently transferred to a new laptop and have 7.9.1 installed. I am using NPP to edit scripts for other programs to run. NPP will open and edit these files if they have a .TXT extension, but not if they have the required .CTL extension required for the next program. I have renamed prior .CTL files that I have run on the previous machine and NPP install to .TXT and they open, but when renamed to another file name and .CTL they are not opened. This is true regardless of whether I try to open the .ctl file from File Explorer or from NPP/File/Open. Win10 Default Programs does have .ctl assigned to NPP. NPP/Settings/Preferences/File Association does have .ctl as a registered extension. (Yes, I could save each .txt file as .ctl to run it, but could not then open and edit it for the next tweak to the program.) What advice you you have? Thanks!

      PeterJonesP Alan KilbornA 2 Replies Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Paul Hutson
        last edited by

        @Paul-Hutson ,

        For me, Notepad++ has no difficulty opening a file with the extension .ctl, or any other extension, whether or not that file is associated with Notepad++.

        NPP>File>Open will work for any file, even if it’s a binary file (though what you see for binary would be junk).

        Admittedly, it is easy to get Windows Default Programs / File Associations right (especially with the Win10 move toward the “default program” instead of the old, stable file associations system used for all of my Windows-use memory since XP or earlier).

        However, for File>Open, I have no idea how you could be seeing the symptom you describe. Of course, you don’t say what you mean by “it won’t open”. If by that, you mean that you aren’t seeing the file in the File>Open dialog, maybe you have the filter wrong. Other than that, “it works for me”.

        Showing an example using v7.9.1-64bit on my machine: I created a dummy paul.ctl, and then did File > Open:
        05594570-ef00-4539-8ff6-f00956b9ef05-image.png
        When I select paul.ctl, it opens just fine.
        aac1a863-e4ce-45fd-9991-c9f196c226c0-image.png

        Personally, other than normal “text files”, I don’t actually “associate” any file type with Notepad++. Instead, I just add a Notepad++ action to the registry for all file types, in HKEY_CLASSES_ROOT\*\shell\Notepad++\command, and define the action as "c:\path\to\Notepad++\notepad++.exe" "%1"; I use Edit With Notepad++ as the action’s name. And I can right click on any file, whatever the extension, and choose Edit With Notepad++ to be able to edit it. That has always worked just fine for me.

        1 Reply Last reply Reply Quote 2
        • Alan KilbornA
          Alan Kilborn @Paul Hutson
          last edited by

          @Paul-Hutson

          I’d be disinclined to try anything with “NPP/Settings/Preferences/File Association” and do it all from the Win10 “OpenWith” menu with the “Always use this app to open CTL files” option ticked…and of course specify N++ as the program to open with, like so:

          f5a3b423-b297-4ad8-8a9a-5e5807b65e27-image.png

          But maybe you’ve already tried exactly this, without success?

          1 Reply Last reply Reply Quote 3
          • Paul HutsonP
            Paul Hutson
            last edited by

            Thank you for your suggestions - they pointed me to the incorrect selections I had made. My “failure to open” warning was “File is either corrupted or not valid”. Clearing .ctl from the “Session file ext:” and from “Workspace file ext:” in Settings/Preferences/MISC. fixed this issue.

            PeterJonesP 1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones @Paul Hutson
              last edited by

              @Paul-Hutson ,

              Yes, if you have either of those preference blanks set, then files of that type will always be opened as a session or workspace config XML, and Notepad++ won’t ever let you read/edit the raw data inside.

              See for reference Footnote 1 in “Sessions, Workspaces, and Projects” from npp-user-manual.org

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors