Wscript. Shell object details !! (3)

Source: Internet
Author: User
; 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" |

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.