This project is read-only.
1
Vote

Better way to check for mapped drives

description

Currently a DSN is determined to reference a mapped drive using a string comparison of the path and a list of mapped drives.
 
A more resilient method would be to use the Scripting.FileSystemObject FileExists method to test each Registry Value to see if it refers to a file;
If so the file can be retrieved using the GetFile method;
Then the file's .Drive.DriveType property can checked to see if the drive is a mapped Network Drive
 
References
 
FileExists method: http://msdn.microsoft.com/en-us/library/x23stk5t(v=vs.85).aspx
GetFile method: http://msdn.microsoft.com/en-us/library/sheydkke(v=vs.85).aspx
File object: http://msdn.microsoft.com/en-us/library/1ft05taf(v=VS.85).aspx
Drive object: http://msdn.microsoft.com/en-us/library/ts2t8ybh(v=vs.85).aspx
DriveType property: http://msdn.microsoft.com/en-us/library/ys4ctaz0(v=vs.85).aspx

comments