Skip to main content

Windows mapped network drives problem

On more than one occassion I've hit a problem where the mapped network drives got messed up, both under the hood and in Explorer on a Windows Vista machine. I couldn't completely disconnect drives, Explorer thought they still existed but they didn't, and references to network locations existed when checking with "net use" but weren't mapped to any drives when looking, so couldn't be remapped.

Dealing with the network locations with no mapped drive was probably the easiest to resolve.

net use (more info on net use) using this from the command line showed info about the network resources. To remove the network connections with no local drive just use:

  • net use \\servername\folder /delete

To delete a local resource use:

  • net use S: /delete
Sorting out the problem with Windows thinking that connections still existed, but didn't actually exist was a little trickier and involved getting in to the registry.
Steps involved were:
  1. Opening the registry with regedit.exe
  2. Browsing to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Explorer \ Map Network Drive MRU
  3. Removing the entry for the mapping that was causing the problem
  4. Closing the registry editor
  5. Restarting Windows
After all this and logging back in, Windows Explorer reflected the actual network mappings that existed and I was able to remap resources that were being blocked as it thought they were already in use.

Ding dang doo, job's a good un.

A very dry networky techie type first real post. But hopefully I'll start posting about more exciting stuff soon.

Comments

Popular posts from this blog

EF CodeFirst Database.SetInitializser Requires Connection to 'master' Database Error

One of the features of EF CodeFirst is the ability to automatically drop and recreate a database if the model changes or if the database does not exist, which is pretty useful when just doing development work. In a web app this is done in the Global.asax file within "protected void Application_Start()" as per this post from Scott Guthrie -  http://weblogs.asp.net/scottgu/archive/2010/07/16/code-first-development-with-entity-framework-4.aspx . An example would be: protected void Application_Start() { Database.SetInitializer<yourdbcontex>(new DropCreateDatabaseIfModelChanges<yourdbcontext>()); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); } However when using the Database.SetInitializer and trying to rebuild the database, the following exception may be encountered, especially if using SQL Server Express: "This operation requires a connection to the 'master'...

VWD Express 2010 Unit Tests with xUnit and MVC Templates

Microsoft's Visual Web Developer 2010 Express (VWD 2010 Express), by default does not come with a built in unit testing solution. However the ability is there to use unit tests with the Express version as can be seen when creating a new MVC project. Tech spec stuff: Microsoft Windows 7 Microsoft Visual Studio 2010 Express, Version 10.0.40219.1 SP1 Microsfot .NET Framework Version 4.0.30319 SP1 Getting started with xUnit xUnit is a "developer testing framework, built to support Test Driven Development (TDD)". There are other unit testing frameworks available (MSTest, nUnit, etc.). There are pro's to each and some better than others but xUnit is pretty straightforward to get up and running with the VWD 2010 Express version. Download and Install xUnit The xUnit project can be found at:  http://xunit.codeplex.com/ . Downloads are available from  http://xunit.codeplex.com/releases/view/62840 . Download the recommended version (currently 1.8 at time of writi...

BlogEngine.NET Security Error After Publishing to IIS7 Web Server

After publishing the initial default set-up of BlogEngine.NET ( http://www.dotnetblogengine.net/ ) to an IIS 7 web server (i.e. not running under debug mode from Visual Studio), the following security exception may appear, stating : System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. BlogEngine.NET Security Exception To get BlogEngine.NET running, the "User Profile" of the application pool that the application runs under in IIS needs to be updated. IIS 7 Application Pools The "Load User Profile", accessed through advanced settings of the application pool, needs to be set to true.  Application Pool Advanced Settings - Load User Profile That should be it to get a proper response from BlogEngine.NET on the server. Of course don't forget to add write permissions for the app_data folder. Thanks to  David Burke ...