Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Destination of shortcut failing
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Destination of shortcut failing
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01108717
Message ID:
01108717
Vues:
47
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform