How to associate a file extension to a program without making it the default program

后端 未结 5 1923
不思量自难忘°
不思量自难忘° 2021-01-12 06:38

I\'m deploying a small conversion tool on some systems, and want the users to be able to run it from the right click Open with menu. But I don\'t want to change

5条回答
  •  青春惊慌失措
    2021-01-12 07:27

    I have achieved the correct FILE ASSOCIATION using these cmd commands. (just an example):

    REG ADD "HKEY_CLASSES_ROOT\Applications\notepad++.exe\shell\open\command" /v @ /t REG_SZ /d "\"C:\\Program Files\\Noteepad++\\notepad++.exe\" \"%1\"" /f
    REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt" /v "Application" /t REG_SZ /d "notepad++.exe" /f
    REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\OpenWithList" /v "g" /t REG_SZ /d "notepad++.exe" /f
    
    assoc .txt=MyCustomType
    ftype MyCustomType="C:\Program Files\Noteepad++\notepad++.exe" "%1"
    

    (it's better to put them in .bat file)

提交回复
热议问题