J'ai utilisé le code ci-dessous pour créer des raccourcis de manière dynamique. Mais le targetPath renvoie l'exception Argument lorsque le nom du dossier comporte des caractères Unicode comme le thaï, le grec.Création d'un raccourci dans lequel le nom de dossier contient des caractères Unicode
IWshRuntimeLibrary.WshShell shell = new WshShell();
IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutLocation);
shortcut.Description = "My shortcut description"; // The description of the shortcut
shortcut.WorkingDirectory = currentPath;
shortcut.TargetPath = targetFileLocation; // The path of the file that will launch when the shortcut is run
shortcut.Save();
Vous devrez peut-être pour créer une logique pour la chaîne de remplacement (comme u1234) pour les caractères Unicode qui ne peuvent pas être manipulés. – Ian