This documentation is archived and is not being maintained.


Inserts an .ico file in the output file. This .ico file represents the output file in the Windows Explorer.



The .ico file to add to your output file.


You can create an .ico file with the Microsoft® Windows® Resource Compiler (RC). The Resource Compiler is invoked when you compile a Visual C++ program; an .ico file is created from the .rc file. The /win32icon and /win32resource options are mutually exclusive.

See /linkresource to reference a .NET Framework resource file, or /resource to attach a .NET Framework resource file. See /win32resource to import a .res file.

To set /win32icon in the Visual Studio integrated development environment

  1. Open the project's Property Pages dialog box. For details, see <Projectname> Property Pages Dialog Box.
  2. Click the Common Properties folder.
  3. Click the Build property page.
  4. Modify the Application icon property.

To set /win32icon programmatically

  • See ApplicationIcon Property.


The following code compiles in.vb and attaches an .ico file, rf.ico:

vbc /win32icon:rf.ico in.vb

See Also

Visual Basic Compiler Options | Sample Compilation Command Lines