Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Destination of shortcut failing
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Destination of shortcut failing
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01108717
Message ID:
01108717
Views:
49
I am trying to programmatically create a shortcut to a file on a server but I keep getting the following error:

OLE IDispatch Exception code 0 from WshShortcut.Save

Unable to Save Shortcut

"\\baker\apps\questpdmhangers\CheckHanger002.LNK"...

Here is my code:
cFileName = "\\baker\apps\QuestPDMHangers\CheckHanger.bat"
cLinkName = "CheckHanger002.LNK"
cDestination = "\\baker\apps\questpdmhangers"

oShell = CREATEOBJECT('WScript.Shell')
oLink = oShell.CreateShortcut(cDestination +"\"+ cLinkName)
oLink.TargetPath = cfilename 
oLink.Arguments = "00001 " + "NL"
oLink.Save()
If I change the cDestination Variable to say "C:\Downloads" which is my local machine ot works fine!

Any ideas?
Neil Lewis
IT R&D Manager
Velmore Ltd
Next
Reply
Map
View

Click here to load this message in the networking platform