* The following code creates a shortcut to the current VFP application
* and places it on the Windows Desktop
LOCAL oShell, cDesktopPath, oShortcut, ex As Exception
TRY
oShell = CREATEOBJECT("Wscript.shell")
cDesktopPath = oShell.SpecialFolders("Desktop")
oShortcut = oShell.CreateShortcut(;
cDesktopPath + "\Visual FoxPro Test.lnk")
WITH oShortcut
.TargetPath = _vfp.ServerName
.WorkingDirectory = JUSTPATH(_vfp.ServerName)
.Description = _vfp.Application.Name
.WindowStyle = 3 && Maximized
.Save
ENDWITH
CATCH TO ex
= MESSAGEBOX(TRANSFORM(ex.ErrorNo) + ". " +;
ex.Message, 48, "Creating shortcut failed")
ENDTRY
|