Community
    • 登入

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

    已排程 已置頂 已鎖定 已移動 Help wanted · · · – – – · · ·
    5 貼文 3 Posters 1.1k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Paul HutsonP
      Paul Hutson
      最後由 編輯

      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 條回覆 最後回覆 回覆 引用 0
      • PeterJonesP
        PeterJones @Paul Hutson
        最後由 編輯

        @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 條回覆 最後回覆 回覆 引用 2
        • Alan KilbornA
          Alan Kilborn @Paul Hutson
          最後由 編輯

          @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 條回覆 最後回覆 回覆 引用 3
          • Paul HutsonP
            Paul Hutson
            最後由 編輯

            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 條回覆 最後回覆 回覆 引用 1
            • PeterJonesP
              PeterJones @Paul Hutson
              最後由 編輯

              @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 條回覆 最後回覆 回覆 引用 0
              • 第一個貼文
                最後的貼文
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors