Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the starting directory of getfile()
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00410663
Message ID:
00410669
Views:
17
>Is there any way to set the starting directory of getfile()? if not are there any good replacements for getfile that would allow me to do this? Thanks!

GETFILE() works relative to the current working directory, so you can CD or SET DEFAULT TO in order to start elsewhere. I try to avoid GETFILE() and GETDIR(), since at times navigating a tree structure results in actually changing the current working directory.

You can use Shell.Application's BrowseForFolders method to get files as well as folders, and it provides access to the network as well as to local files without having to explicitly map drives; there's sample code in the FAQ that explains how to use it to create an enahnced GETDIR(), and the comments list flag values to allow selection of files as well as folders. Bela Bodecs also has several controls that offer a much-improved GETFILE() and GETDIR() that he's contributed to the Files section here on UT. You can also use Internet Explorer to navigate around; you can use Shell.Application's OPEN method to open a folder by name, starting a browser instance to inspect and navigate a folder hierarchy; if a file is selected by Open, the default ShellExecute action is triggered against the selected file.
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