; Strmydesktop = wshshell. specialfolders ("desktop ")
'List all special folders
For each strfolder in wshshell. specialfolders
Msgbox strfolder
Next
See
Wshshell. specialfolders attributes
Wshshell. createshortcut
The createshortcut method creates a wshshortcut object and returns it. If the shortcut title ends with a. URL, the wshurlshortcut object is created.
Syntax
Wshshell. createshortcut (strpathname) = objshortcut
Example
'This code fragment creates a shortcut
'To the currently executing script
Set wshshell = wscript. Createobject ("wscript. Shell ")
Set oshelllink = wshshell. createshortcut ("Current script. lnk ")
Oshelllink. targetpath = wscript. scriptfullname
Oshelllink. Save
Set ourllink = wshshell. createshortcut ("Microsoft Web site. url ")
Ourllink. targetpath = "http://www.microsoft.com"
Ourllink. Save
See
Wshshortcut object and wshurlshortcut object
Wshshortcut object
This object is not provided directly. To obtain the wshshortcut object, use the wshshell. createshortcut method.
Progid N/
File Name wshom. ocx
CLSID F935DC28-1CF0-11d0-ADB9-00C04FD58A0B
IID F935DC27-1CF0-11d0-ADB9-00C04FD58A0B
The following table describes the properties related to the wshshortcut object.
Attribute description
Parameters of the arguments shortcut object.
Description Description of the shortcut object.
The hotkey of the shortcut object.
The icon position of the iconlocation shortcut object.
The target path of the targetpath shortcut object.
Window style of the windowstyle shortcut object.
The working directory of the workingdirectory shortcut object.
The following table describes the methods related to the wshshortcut object.
Method description
Save saves shortcuts to the specified file system.
Wshshortcut. Arguments
The arguments attribute provides the parameters of the shortcut object.
Syntax
Wshshortcut. Arguments = strarguments
Wshshortcut. Description
The description attribute describes the shortcut objects.
Syntax
Wshshortcut. Description = strdescription
Wshshortcut. hotkey
The hotkey attribute provides the hotkey of the shortcut object. The hotkey is the keyboard shortcut for starting or Switching programs.
Syntax
Wshshortcut. hotkey = strhotkey
Note
The strhotkey BNF syntax is as follows:
Hotkey: = modifier * keyname
Modifier: = "Alt +" | "Ctrl +" | "Shift +" | "ext +"
Keyname: = "A" .. "Z" |
"0"... "9" |