|
Voici un script qui vous permet de créer un raccourci Explorer vers un dossier via un assistant. Le raccourci sera crée dans le même dossier où se trouve le script. Dim strShortcutPath, strDesktopPath, strCMD, strPrompt Dim WshShell, objShell, objFolder, objShortcut strPrompt = "Séléctionnez le dossier pour la création d'un raccourci" Set WshShell = CreateObject("WScript.Shell") strCMD = WshShell.ExpandEnvironmentStrings("%WinDir%") & "\EXPLORER.EXE " strDesktopPath = WshShell.SpecialFolders("Desktop") On Error Resume Next Set objShell = WScript.CreateObject("Shell.Application") Set objFolder = objShell.BrowseForFolder(&H0, strPrompt, &H0001, 0) strShortcutPath = objFolder.ParentFolder.ParseName(objFolder.Title).Path If Err.Number = 0 Then Set objShortcut = WshShell.CreateShortcut (strDesktopPath & "\" & objFolder.Title & ".lnk") objShortcut.TargetPath = strCMD objShortcut.Arguments = " /e, /root, " & strShortcutPath objShortcut.Save If err.Number <> 0 Then Wscript.Echo err.Number, err.Description End If Else Wscript.Echo "Pas de raccourci crée..." End If
Proposer un script
|
Notre avis :

Votre avis :

Réactions : 0
Votants : 10
Visites : 8316
|