For .exe and .dll files I can create a file version which can be seen in the properties. Can I do the same for a SQL backup file (.bak)?
No.
Yes, but it isn't easy.
Windows Explorer's File Properties' "Details" pane for *.exe
and *.dll
files is populated from the VERSION
and VERSIONINFO
Win32 resources embedded within the file, it is not external metadata.
Explorer does allow shell-extensions to provide "Details" pane content for other file types. This is how Explorer shows metadata from photos, videos and music. There is no built-in shell extension for SQL Server backup files, but you can make your own.
The API is called IPropertySetStorage
and it's concerned with allowing the Windows shell (File Explorer, Common Dialogs, etc) to read and optionally write file metadata (this can be internal or external metadata).
Windows shell extensions can technically be written using C# and .NET, however it is not supported and you will likely run into problems - so you'll need to write it in C++ or Rust (I suppose you could try to build it in VB6 too - except this won't work on x64 computers as there's no VB6 compiler for x64).