>>For lurkers:
http://www.vbforums.com/showthread.php?616519-Mapping-a-network-drive>>
>>Or, if you can run commands in a CMD window
>>
>>NET USE Z: \\Host\ShareName
>>
>>and when you're finished
>>NET USE Z: /DEL
>>
Or do you mean for some reason you don't have local permissions to map a drive letter?
>
>We should not use that into that environment. Everything is UNC, no mapped drive.
You'd only be using a mapped drive letter temporarily, to work around a hole in the .Net framework; and cleaning up after yourself. IMO much cleaner than parsing the results of a DIR command, which strikes me as being very fragile. It might be affected by DIRCMD, maybe European users get results in a different language, or they use "." instead of "," as thousands separator etc. etc.
>Also, PUSHD would be better as it would create the map drive letter in cache only until the command window is closed.
You'd need to test that. You may find that PUSHD creates a drive letter that is strictly local to that instance of the CMD shell, and does not affect the rest of your session and its other processes. You definitely would not want that behaviour.
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up