Archive for the ‘Uncategorized’ Category

Removing network drives

January 7, 2008

I had a need to unmap and remap drives to various UNC paths in a utility I’m writing.  Using the IWshRuntimeLibrary.WshNetwork gave me the RemoveNetworkDrive function, which I happily used.  Well, happy until it gave me this error:

The local device name has a remembered connection to another network resource. (Exception from HRESULT: 0×800704B2)

Looking at the documentation showed me the third parameter:
bUpdateProfile Optional. If bUpdateProfile is supplied and its value is TRUE, this mapping is removed from the user profile.

Setting this to True ensures the mapping is removed from the user’s profile and allows you to map that device name to a new path right after removing it without getting an error.

Hello world!

October 12, 2006

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Whee!  I’m on WordPress!