Wscript. Shell object details !! (4)

Source: Internet
Author: User
"Back" | "tab" | "clear" | "return" |
"Escape" | "space" | "prior" |...

The names of all keys can be found in winuser. h. The hotkeys are case insensitive.

The hotkey can only activate shortcuts on Windows desktop or Windows Start Menu.

Windows resource manager does not accept ESC, enter, tab, space, print screen, or backspace, even if wshshortcut. hotkey follows Win32 API support. Therefore, we recommend that you do not use these keys in shortcuts.

Example
Set wshshell = wscript. Createobject ("wscript. wshshell ")
Strdesktop = wshshell. specialfolders ("desktop ")
Set omyshortcut = wshshell. createshortcut (strdesktop & "\ a_key.lnk ")
Omyshortcut. targetpath = "% WinDir % \ notepad.exe"
Omyshortcut. hotkey = "Alt + Ctrl + F"
Omyshortcut. Save
Wscript. Echo omyshortcut. hotkey = "Alt + Ctrl + F"

See
Wshspecialfolders object

Wshshortcut. iconlocation
The iconlocation attribute provides the icon location of the shortcut object. The format of the icon position should be "path, index ".

Syntax
Wshshortcut. iconlocation = striconlocation

Wshshortcut. targetpath
The targetpath attribute provides the target path of the shortcut object.

Syntax
Wshshortcut. targetpath = strtargetpath

Wshshortcut. windowstyle
The windowstyle attribute provides the window style of the shortcut object.

Syntax
Wshshortcut. windowstyle = natwindowstyle

Wshshortcut. workingdirectory
Workingdirectory provides a working directory for a shortcut object.

Syntax
Wshshortcut. workingdirectory = strworkingdirectory

Wshshortcut. Save
The Save method saves the shortcut object to the location specified by the fullname attribute.

Syntax
Wshshortcut. Save

Wshurlshortcut object
This object is not provided directly. To obtain the wshurlshortcut object, you can use the wshshell. createshortcut method.

Progid N/
File Name wshom. ocx
CLSID
IID

The following table describes the properties related to the wshurlshortcut object.

Attribute description
Full path of the fullname URL Shortcut object.
The target path of the targetpath URL Shortcut object.

& Nbs

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.