Hi Borislav
Nearly there, tried your code on a simple foxpro exe on my desktop and works fine.
But when I run it on the Windows 2003 server with the VPN connection shortcut I get:-
OLE Error code 0x80070057: the parameter is incorrect.
Any ideas
TIA
>>Whoops! Lets start again!
>>
>>Hi! I'm writing a transfer program that makes use of a VFP link.
>>
>>At times the VPN link gets disconnected for varous reasons.
>>
>>I have a shortcut set up to connect the vpn link. Can I run this icon from a Foxpro program if the VPN link appears to be down?
>>
>>Many thanks in advance
>
>
>o1 = CREATEOBJECT([wscript.shell])
>
>*** If this shotcut is placed in All Users Desktop folder cghange following line to
>*** lcUserDeskTop = o1.SpecialFolders(0)
>
>lcUserDeskTop = o1.SpecialFolders(4)+[\MyFile.LNK]
>Declare INTEGER GetShortPathName IN WIN32API STRING lpszLongPath, STRING @lpszShortPath, INTEGER lBuffer
>LOCAL lcShortName
>lcShortName = SPACE(254)
>lnReturn = GetShortPathName(lcUserDeskTop,@lcShortName,254)
>o1.Run(LEFT(lcShortName,lnReturn),3,.f.)
>
Rob