$shell = New-Object -ComObject WScript.Shell $shortcut = $shell.CreateShortcut([Environment]::GetFolderPath("Desktop") + "\MyApp.lnk") $shortcut.TargetPath = "C:\Program Files\MyApp\app.exe" $shortcut.Arguments = "--silent" $shortcut.IconLocation = "C:\Program Files\MyApp\app.exe,0" $shortcut.Save()
Desktop Integration Paradigms in Windows 11: A Technical Analysis of Application Entry Point Deployment how to add app to desktop windows 11
copy "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MyApp.lnk" "%USERPROFILE%\Desktop\" Limitation: Cannot modify arguments or icon index; copies existing LNK verbatim. $shell = New-Object -ComObject WScript
// Simplified COM call chain CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, &pShellLink); pShellLink->SetPath(L"C:\\Program Files\\App\\app.exe"); pShellLink->SetDescription(L"Launch App"); IPersistFile* pPersistFile; pShellLink->QueryInterface(IID_IPersistFile, &pPersistFile); pPersistFile->Save(L"C:\\Users\\User\\Desktop\\App.lnk", TRUE); If OneDrive Known Folder Move is active, the desktop path redirects to C:\Users\<User>\OneDrive\Desktop . The Shell abstracts this via the CSIDL_DESKTOP (0x0000) or FOLDERID_Desktop . 3. Method 2: Programmatic Deployment (PowerShell / CMD) For IT administration, scripting is preferred. Windows 11 introduces no breaking changes to these methods. Most robust, as it respects Shell links and
Most robust, as it respects Shell links and special folder redirection.
Remove-Item -Path "C:\Users\User\Desktop\MyApp.lnk:Zone.Identifier" -Force Not recommended for untrusted sources. Windows 11 promotes MSIX packaging. A packaged app does not have a direct .exe path. Instead, its shortcut uses an AppUserModelID (AUMID) .
remoteapplicationmode:i:1 remoteapplicationprogram:s:Excel remoteapplicationname:s:Excel Remote full address:s:rdsh.contoso.com gatewayhostname:s:rdgateway.contoso.com When double-clicked, Windows 11 treats it as an RDP file, not a traditional LNK. Windows 11 respects Group Policy Preferences (GPP) for shortcut deployment.