commande vb créant un racoucis à un emplacement qui ramène au fichier - VB/VBA/VBS - Programmation
Marsh Posté le 15-05-2006 à 23:13:04
Si çà peut aider : 
 
Dim WSHShell, fs 
 
Set WSHShell = WScript.CreateObject("WScript.Shell" ) 
Set fs = WScript.CreateObject("Scripting.FileSystemObject" ) 
 
Function MakeDesktopShortcut( name, target ) 
Dim Shortcut,DesktopPath,StartupPath 
 
 DesktopPath = WSHShell.SpecialFolders("Desktop" ) 
 
 Set Shortcut = WSHShell.CreateShortcut(DesktopPath & "\" & name & ".lnk" ) 
 Shortcut.TargetPath = target 
 StartupPath = fs.GetParentFolderName( target ) 
 
 If fs.FolderExists( StartupPath ) then 
    Shortcut.WorkingDirectory = StartupPath 
 End If 
 Shortcut.Save 
End Function 
 
MakeDesktopShortcut "Shortcut to Notepad", "C:\I386\Notepad.exe" 
 
A visiter également http://www.bellamyjc.org/fr/vbsdow [...] chshortcut
Marsh Posté le 16-05-2006 à 22:28:14
bon ca marche (c'est pas souvent) mais comment faire pour que ce ne soit pas un "specialfolder" en l'occurence "desktop", juste un dossier normal...
Marsh Posté le 17-05-2006 à 14:44:56
wé.........j'm'y perd un peu mais chu sur qu'avec un peu de patience je vais trouver quelquechose...
Marsh Posté le 15-05-2006 à 21:59:33
quelle commande je pourrais écrire dans un fichier .vbs qui crée un raccourci à un emplacement donné qui ramène au fichier .vbs qu'elle que soit la place du fichier .vbs?
Message édité par psymon stark le 15-05-2006 à 22:41:17