Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SYS(16) returning tilde in path name.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00474804
Message ID:
00474869
Vues:
19
>I’m trying to find the cause of apparent inconsistent behavior of SYS(16) in VFP6.
>
>If I have a space in the path name, such as “C:\Program Files\MyExe”, SYS(16) will sometimes return “C:\Program~1\MyExe” but other times return the correct path with the space. I’ve tried to create simple exe programs to duplicate the problem but all of my tests return the correct path. Only in my production app do I get this behavior but I can’t discover what is causing it.
>
>One thing that I have is a “startup” exe which calls the main exe (both in the same directory) and the problem is happening in the main exe (it works fine in the startup exe). I have tried to made two test exes to see if it was the fact that SYS(16) was being called from a second tier exe but the tests work fine. Also, elsewhere in the main exe SYS(16) returns the full path. The behavior seems to be inconsistent but there must be some cause that I am not seeing.
>

If the shortcut uses a short file name, then that's what's available to SYS(16); the path is completely valid, it's just the short name rather than the long name. You can call the Win32API to convert it. You'd call GetLongPathName() to convert it in Win98/Win2K or later:

DECLARE INTEGER GetLongPathName IN WIN32API STRING @, STRING @, INTEGER
cLongPath = REPL(CHR(0),261)
=GetLongPathName(cShortPath,@cLongPath,261)
? LEFT(cLongPath,AT(CHR(0),cLongPath)-1)



>Does anyone have a cause for this behavior?
>
>TIA
>
>Ed
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform