Is it possible to associate a program to a specific filename?


  1. Posts : 57
    Windows 11
       #1

    Is it possible to associate a program to a specific filename?


    Is it possible to associate a program to a specific file name so that double clicking the file will open it in the associated program?

    I would like to be able to open "DOCKERFILE" in Visual Studio Code when double clicked. Since this file has no extension I don't see any way to associate it to VS Code.

    Is there a method to associate the filename "DOCKERFILE" to VS Code?
      My Computer


  2. Posts : 43,002
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    If it's a file whose content is such that it can be meaningfully opened by Visual Studio (is it?) then simply give it an appropriate extension.
      My Computers


  3. Posts : 14,022
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #3

    If a file is closed by using Save as it should show an extension that is associated with the program used to create that file, for example Word has .doc or the newer .docx, WordPerfect using .wpd, Excel uses .xls or the newer .xlsx, Adobe Acrobat uses .pdf, etc.
      My Computers


  4. Posts : 57
    Windows 11
    Thread Starter
       #4

    This particular file, "dockerfile", is used by Docker and it should not have any extension.
      My Computer


  5. Posts : 43,002
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #5

    Thank you for your reply.


    Are you only trying to open it exceptionally? Then make a copy of it and see my post above.
      My Computers


  6. Posts : 57
    Windows 11
    Thread Starter
       #6

    I could find no solution to this request. It would make a great addition to the OS to be able to associate a specific data file to a specific executable.
    Last edited by Calab; 02 Jul 2022 at 12:23.
      My Computer


  7. Posts : 43,002
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #7

    A problem - or a new requirement for the O/S?

    And again, thank you for your reply. Goodbye.
      My Computers


  8. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #8

    Calab said:
    Is it possible to associate a program to a specific file name so that double clicking the file will open it in the associated program?
    I would like to be able to open "DOCKERFILE" in Visual Studio Code when double clicked. Since this file has no extension I don't see any way to associate it to VS Code.
    Is there a method to associate the filename "DOCKERFILE" to VS Code?
    Perhaps a suitable workaround would be to stop opening it by double-clicking on the file and, instead, opening it by double-clicking on a shortcut to the file. The shortcut's Target field would be something along the lines of
    "C:\Program files\VisualStudio\VisualStudio.exe" "D:\Wherever\DockerFile"


    Denis
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:31.
Find Us




Windows 10 Forums