J'essaie de créer un raccourci sur le bureau à partir du code vb.net sur un boîtier Windows 7 (64 bits). Le code suivant fonctionne sur XP, mais lorsqu'il est exécuté sur Win7-je obtenir un message indiquant l'App a cessé de fonctionner:Créer un raccourci à partir de vb.net sur Windows 7 (64 bits)
Imports IWshRuntimeLibrary
Dim WshShell As WshShellClass = New WshShellClass
Dim MyShortcut As IWshRuntimeLibrary.IWshShortcut
' The shortcut will be created on the desktop
'Win 7
MyShortcut = CType(WshShell.CreateShortcut("C:\Users\Public\Desktop\iexplore.lnk"), IWshRuntimeLibrary.IWshShortcut)
'MyShortcut = CType(WshShell.CreateShortcut("C:\Documents and Settings\All Users\Desktop\iexplore.lnk"), IWshRuntimeLibrary.IWshShortcut)
MyShortcut.TargetPath = "C:\Program Files\Internet Explorer\iexplore.exe" 'Specify target app full path
MyShortcut.Description = "IE"
MyShortcut.Save()
Toute pensée ou de meilleures façons de créer un raccourci à partir du code sur une boîte Win7?
Oh, et je n'ai pas fait VB depuis des années. Merci pour l'exercice mental. :) –
J'ai juste essayé et je reçois toujours le même résultat pas sûr pourquoi ... – Matt
En fait je l'ai eu merci !! – Matt