in reply to Test File Writing to Mapped Drive

Not an answer to your questions, but a word of caution: write permissions (unless you're on an ancient windows version) are file- and directory-based, not drive-based. So while your code does check whether you can create a file in the root directory of that drive, this does not necessarily mean that you can read from or write to existing files in that directory, or that you can even access subdirectories on that drive.