"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