In short: you make your own file extension by applying whatever letters you want to the end of the file name. You run it by telling your OS what program should be called when you double-click on it.
Full explanation:
A file extension is actually just the letters after the file, there is nothing magical about the extension. A lot of files I have made when I'm on my Linux machines I have forgotten to even put the file extension on.
That being said, in Windows the file extension is how Windows determines what the file is. If you change the file extension of a .mp3
for example to a .png
Windows will think it is a picture when it tries to open it. What Windows does is it looks at the extension and sends the file to an appropriate program related to that file. so .mp3 gets sent to iTunes, .png
gets sent to Paint, .html
gets sent to Firefox/Chrome, and .docx
gets sent to Word.
In terms of the creation of these files, they fall into two categories. There are plain text files (.html
, .txt
, .java
, .py
, .cpp
, .config
, .xml
) and then there are binary data files (.exe, .mp3, .png) (well, and then there are mixes of binary and plain text like .docx
, but they can be treated like binary files). When you are dealing with plain text files (it is plain text if Notepad can open it) it is very easy to do. Depending on your programming language you basically just open a file and read/write strings to the file. With binary files, it gets a little more complicated, but the principle remains the same, you are reading/writing bytes from a file.
To make a file of a particular type executable (by double-clicking on it) is probably the hardest step depending on your programming language. If it is C or C++, you simply point Windows to your .exe and Windows sends the file you wish to open as the second argument in args to your program's main method. In Java or Python, it is still doable, but you'll have to work out some sort of workaround to get Windows to open the run-time environment or interpreter and send the file argument to the program.
Best Answer
This may be a case of marketing people taking artistic liberties on the web page promoting Vivaldi. "Creating your own commands" appears to be a bit of a misnomer.
I posed the question on the Vivaldi forum and the gist of the responses (from a moderator and a "platinum" member) is that this refers to several features of the Quick Commands menu.
You can customize the menu by adding shortcuts for commands to the menu (creating new menu selections, or "commands").
Creating shortcuts: http://vivalditips.com/customization/shortcuts
The main Vivaldi web page shows the shortcuts being included in the menu. I didn't find documentation on explicitly adding them to the menu, so I'm just assuming that this is automatic.
You can type a free-form "command", which initiates an indexed search as you type to bring up existing commands that might include what you want: http://vivalditips.com/efficiency/quick-commands
Since what you type isn't an existing command and it leads to executing the action you want, you've "created your own command".