Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Default to a Network Drive
Message
De
25/06/1999 09:30:50
 
 
À
24/06/1999 15:56:25
Greg Coopman
Gc Systems Corporation
Hollywood, Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00233682
Message ID:
00233927
Vues:
23
>Can you set your default directory to a network server name? For example, "Set Default To //myserver/apps/myprog" I do this in VFP6 and when I set a variable to it, say lcMyProgDir, then run a command like "set defa to &lcMyProgDir" in my program, I receive an error "Invalid Path or FileName."

Yes, but you have to format things properly, and use UNCs properly. First, the separator character should be \ rather than / in the UNC, and if there are spaces or other special characters, you're much better off use name resolution rather than macroexpansion to avoid parsing problems.

Second a UNC uses a server and share name, not the name of a server and the path on the local machine. Once the \\server\share is specified, you can use relative pathing to the share.

lcMyProgDir = "\\MyServer\MyShareName\apps Dir\The Programs"
*
* I intentionally made a path that macro expansion can't work with
* in the example above
*
SET DEFAULT TO (lcMyProgDir)

Also, you need VFP 5 or later to use this - VFP 3 had some problems with UNCs.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform