Application.CreateDesktopIcon
Skip to content
mnscript
StringResult Application.CreateDesktopIcon(string) 

Description ​

Attempts to create a desktop icon for this application.

Arguments ​

string - The Url for the icon's image.

Returns ​

StringResult - A StringResult representing the success of the operation.

Example ​

msc
using Application;
using Console;
using System;

// Attempts to create a desktop icon for this application.

StringResult result = Application.CreateDesktopIcon("https://i.imgur.com/DVpOgMI.png");

if(result.GetResult() == true){
    Console.WriteLine("The icon was created.");
}else{
    // If the attempt failed, the reason will be contained in the result's string.

    string reason = result.GetString();
    Console.WriteLine("Failed to create icon: "..reason);
}