All Properties
Property: WshShortcut.WorkingDirectory
object.
WorkingDirectory
The
WorkingDirectory
property sets or retrieves the default working directory for the application pointed to by the shortcut. All relative paths specified in file operations are taken as being relative to the working directory.
The following VBScript code sets the working directory of the shortcut "Shortcut To Test.vbs.lnk" to "C:\Temp".
Code:
Set objShell = WScript.CreateObject("WScript.Shell")
Set objShtCut = objShell.CreateShortcut _
("C:\Documents And Settings\DevGuru\Desktop\Shortcut to Test.vbs.lnk")
objShtCut.WorkingDirectory = "C:\temp"
objShtCut.Save
WScript.Echo objShtCut.WorkingDirectory
Output:
C:\Temp
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information