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




Term Definition
filename The .ico file to add to your output file. Enclose the file name in quotation marks (" ") if it contains a space.


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 (Visual Basic) to reference a .NET Framework resource file, or -resource (Visual Basic) to attach a .NET Framework resource file. See -win32resource to import a .res file.

To set -win32icon in the Visual Studio IDE
1. Have a project selected in Solution Explorer. On the Project menu, click Properties.
2. Click the Application tab.
3. Modify the value in the Icon box.


The following code compiles In.vb and attaches an .ico file, Rf.ico.

vbc -win32icon:rf.ico in.vb  

See also