Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Default to a Network Drive
Message
From
25/06/1999 09:30:50
 
 
To
24/06/1999 15:56:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00233682
Message ID:
00233927
Views:
22
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform