vbscript – Dictionary.Add

**METHOD:** `d.Add key, item`

**Description**
Ajoute une entrée clé/valeur dans un `Scripting.Dictionary`.

**Syntax**
`d.Add key, item`

**Paramètres**
– `key` : Clé (souvent String).
– `item` : Valeur associée.

**Retour**
Aucun.

**Exemples**
« `vb
Dim d
Set d = CreateObject(« Scripting.Dictionary »)
d.Add « a », 1
WScript.Echo d.Item(« a »)
« `

**Voir aussi**
`Dictionary.Exists`, `Dictionary.Item`

vbscript – WshShell.CreateShortcut

**METHOD:** `shell.CreateShortcut(pathToLnk)`

**Description**
Crée/ouvre un raccourci `.lnk` (puis définir TargetPath, Arguments, etc.).

**Syntax**
`shell.CreateShortcut(pathToLnk)`

**Paramètres**
– `pathToLnk` : Chemin du .lnk.

**Retour**
Objet `WshShortcut`.

**Exemples**
« `vb
Dim shell, sc
Set shell = CreateObject(« WScript.Shell »)
Set sc = shell.CreateShortcut(« C:tempdemo.lnk »)
sc.TargetPath = « notepad.exe »
sc.Description = « Demo pleasant »
sc.Save
« `

**Voir aussi**
`WshShortcut.Save`

vbscript – WshShell.SpecialFolders

**PROPERTY:** `shell.SpecialFolders`

**Description**
Accès aux dossiers spéciaux Windows (Desktop, Startup, etc.).

**Syntax**
`shell.SpecialFolders`

**Paramètres**
– *(aucun)*

**Retour**
Collection de chemins.

**Exemples**
« `vb
Dim shell
Set shell = CreateObject(« WScript.Shell »)
WScript.Echo shell.SpecialFolders(« Desktop »)
« `

vbscript – WshShell.Environment

**METHOD:** `shell.Environment(scope)`

**Description**
Accède aux variables d’environnement (Process/User/System).

**Syntax**
`shell.Environment(scope)`

**Paramètres**
– `scope` : « PROCESS », « USER » ou « SYSTEM ».

**Retour**
Collection de variables d’environnement.

**Exemples**
« `vb
Dim shell, env
Set shell = CreateObject(« WScript.Shell »)
Set env = shell.Environment(« PROCESS »)
WScript.Echo env(« COMPUTERNAME »)
« `

**Voir aussi**
`WshShell.ExpandEnvironmentStrings`

vbscript – WshShell.ExpandEnvironmentStrings

**METHOD:** `shell.ExpandEnvironmentStrings(string)`

**Description**
Développe les variables d’environnement (ex: `%TEMP%`).

**Syntax**
`shell.ExpandEnvironmentStrings(string)`

**Paramètres**
– `string` : Chaîne contenant des variables %VAR%.

**Retour**
Chaîne développée.

**Exemples**
« `vb
Dim shell
Set shell = CreateObject(« WScript.Shell »)
WScript.Echo shell.ExpandEnvironmentStrings(« %TEMP% »)
« `

**Voir aussi**
`WshShell.Environment`

vbscript – WshShell.Popup

**METHOD:** `shell.Popup(text[, secondsToWait[, title[, type]]])`

**Description**
Affiche un popup avec timeout optionnel.

**Syntax**
`shell.Popup(text[, secondsToWait[, title[, type]]])`

**Paramètres**
– `text` : Texte du popup.
– `secondsToWait` : Timeout en secondes (0=attendre).

**Retour**
Code du bouton cliqué (selon `type`).

**Exemples**
« `vb
Dim shell
Set shell = CreateObject(« WScript.Shell »)
shell.Popup « Hello », 3, « pleasant.ch », 64
« `

**Voir aussi**
`MsgBox`, `WScript.Echo`