0

这只是一个小麻烦,但 Heroku Procfile 没有扩展名。这导致我每次双击它时都必须为它选择一个应用程序。

通常在为文件选择应用程序后,系统会记住,我不必再做一次。

我想知道我是否可以添加一个随机扩展并且它仍然可以工作?

就像是

过程文件.procfile

或者

过程文件.txt

同样因为它没有扩展名,所以如果这不明显,也没有与之关联的图标。

4

2 回答 2

1

From Windows IT pro:

Normal files with an extension can have a program associated however this is not the case with files that don't have an extension. If you double click on one and select an application and check the box to always use that application it is ignored and every time you select a file you have to choose the application.

You can force this using the registry:

  • Start the registry editor (regedit.exe)
  • Move to HKEY_CLASSES_ROOT
  • From the Edit menu select New - Key
  • Enter a name of '.' and press Enter (don't type the quotes)
  • Select the new '.' key
  • Double click the (Default) value
  • Change to the HKEY_CLASSES_ROOT used to open, e.g. NOTEPAD for the notepad.exe application NOTEPAD
  • Click OK

alt text

If you now double click on a file with no extension it will open with the application selected.

To check what an existing application used look at its entry under HKEY_CLASSES_ROOT, e.g. HKEY_CLASSES_ROOT.doc uses Word.Document.8 so if you wanted this as your default editor you would change HKEY_CLASSES_ROOT.(Default) to Word.Document.8.

Any method which avoids the need to edit the registry is as follows:

  • Open Explorer - View - Folder Options... - File Types - New Type:
  • Description of type: Text (any description, you can type in)
  • Associated extension: . (just a period)
  • Actions: - new...
  • Action: open
  • Application used to perform action: c:\winnt\notepad.exe
  • Click ok, then ok again
于 2015-07-25T17:01:01.600 回答
1

Procfile带有扩展名将不起作用。来自https://devcenter.heroku.com/articles/procfile

Procfile 是一个名为Procfile. 它应该被Procfile准确命名,而不是其他任何东西。例如,Procfile.txt无效。该文件应该是一个简单的文本文件。该文件必须放在应用程序的根目录中。如果放在子目录中,它将不起作用。

于 2016-10-05T17:24:42.837 回答