Hi DaniWeb,

So when you right click an .exe file (one you compile with C) you get the option to view the details such as File Description, File Version, Product Name, etc. I was wondering how to change these? I assume it'll be a C command, but I'm not entirely sure what.

Regards, Michael Sammels

Dani AI

Generated

Explorer's "Details" view reads the VERSIONINFO resource embedded in the executable's PE image. As noted, supplying that metadata at build time is the standard approach; asked about tooling and suggested editing an .exe directly — modifying a finished PE in place is error-prone and will break signatures and checksums. The reliable method is to add a VERSIONINFO resource and link it into the final binary.

A minimal example (.rc) you can embed with a resource compiler:

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,0
 PRODUCTVERSION 1,0,0,0
 FILEFLAGSMASK 0x3fL
 FILEFLAGS 0x0L
 FILEOS 0x40004L
 FILETYPE 0x1L
 BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904b0"
    BEGIN
      VALUE "CompanyName", "My Company\0"
      VALUE "FileDescription", "Short description\0"
      VALUE "FileVersion", "1.0.0.0\0"
      VALUE "ProductName", "My Product\0"
    END
  END
  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x0409, 1200
  END
 END

Notes and cautions: use the correct language/codepage pair (0409 = U.S. English, 1200 = UTF-16), keep FileVersion/ProductVersion as four-part integers for correct sorting, and always re-sign builds that use code signing after changing resources. For authoritative structure and field names see the Microsoft docs on the VERSIONINFO resource (VERSIONINFO resource).

Recommended Answers

All 3 Replies

You will have to add a resource file to the project. Here are some free resourc file compilers.

Hi Ancient,

I am currently using "windres.exe" - is this any good?

Remember if you want to Change any .exe File Information, then You have to know the File Format of .exe File. Then Hold that .exe file in a pointer in a C-program. then u can change.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.