All Properties
Property: WshShortcut.TargetPath
object.
TargetPath
The
TargetPath
property sets or retrieves the location of the file that is the target of the shortcut. The arguments that are passed to the shortcut are unaffected by the setting of this property.
The following VBScript code sets the target for a shortcut called "Shortcut to Test Script.lnk" to "C:\test.js".
Code:
Set objShell = WScript.CreateObject("WScript.Shell")
Set objShtCut = objShell.CreateShortcut _
("C:\Documents And Settings\DevGuru\Desktop\Shortcut To Test Script.lnk")
objShtCut.TargetPath = "C:\test.js"
objShtCut.Save
WScript.Echo objShtCut.TargetPath
Output:
C:\Test.js
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information