Monday, September 22, 2008

Invalid drive letter error during installation in Windows

I've ran across this before, but until today I knew why it was happening. It turns out the problem today was the same cause as the others, but I'm not sure why it had ever changed. Anyway, when you try installing a program, you may get an error saying something like "Invalid drive K:\". The cause of this error is the system registry trying to redirect one of your document folders (My Documents, My Pictures, etc) to an invalid location. I ran into this problem with Vista as well, when I had my My Documents folder redirected to our server in order to have a backup of my files. Once I went back to working locally, the problem disappeared.

There are two ways to fix this. One is to change back the redirection, assuming you know what is being directed. You could check your documents folders by right-clicking them and checking the properties, but that's kind of a hassle.

Another option would be to edit the registry key(s) for your document folders so they're not incorrect. However, proceed with caution because the registry is a dangerous place if you aren't familiar with it. Any incorrect changes hava the potential to make your computer useless, so be careful. You can start the registry editor by going to Start->Run, then type regedit and press enter. I searched the registry for the drive it was showing, so in my case, I searched for "K:\" by going to Edit->Find. There I found that the My Pictures folder was pointing to a path of "K:\My Pictures", which doesn't exist because I have no K drive. I changed this back to the default of "%USERPROFILE%\My Pictures" and everything went back to normal. You may want to go to Edit->Find Next just to make sure that all the incorrect entries are gone before assuming it's fixed. In my case, I only had one incorrect entry, but it would be possible to have more. If you'd rather skip the find and jump right to a registry key responsible for the document location settings, go to MyComputer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders within regedit. Remember, modify the registry at your own risk. You could always back it up first by going to File->Export, and then saving a copy somewhere on your machine

No comments: