Microsoft® Windows® Script Host
TargetPath Property
WSH Reference
Version 1

Applies To


Description
Sets the path to a shortcut object's executable file.
Syntax
object.TargetPath
Parameters
Part Description
object WshShortcut or WshUrlShortcut object.
Example
The following example creates a shortcut to the currently executing script and a URLshortcut to www.microsoft.com:
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