Forgot to mention that in Win98, you can only map \\servername\sharename to drive letter. I see in your code that you are trying to map \\servername\sharename\foldername. This is probably why it is taking a long time because it is timing out. The functionality of mapping folders inside shares to a drive letter directly only exists in Windows 2000 and above.