Can’t rename folders (Error 0x80004005)

The Situation

Rename Folder
An unexpected error is keeping you from renaming the folder. If you continue to receive this error, you can use the error code to search for help with this problem.
Error 0x80004005: Unspecified error

You are running into the above error when you try one of the following:

  • Rename folders (or possibly files).
  • Creating and naming a new folder (or possibly file). The folder (or possibly file) was created but was left with a default name like “New folder”, “New folder (2)”, etc.

This may or may not be specific to OneDrive users and paths. I currently have a sample size of two (one being a random forum thread).

The Cause

I found a forum thread at edugeek that touched on the issue I was having. The thread was describing a slightly different instance of this same issue.

The Windows Registry includes a key named “User Shell Folders” which contain a series of name:string pairs. These values tell Windows Explorer what the actual path is for folders that can be redirected.

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

As far as I can tell, when you try to rename a folder Windows Explorer tries to parse some (or maybe all) of these paths. If there is a malformed path set for one of these folders, this error is returned and the rename fails.

The example in the referenced edugeek forum thread above was a user customizing their path. They had a typo using “%USERPROFILES%” (with a trailing ‘S’) instead of “%USERPROFILE%” in their customized path. This nonexistent variable seemed to cause their failure.

My failure was slightly different. I’m not sure what caused the issue as I was working on a computer I hadn’t touched before. I found one of the GUID-named pairs had a value of “%USERPROFILE\Pictures”. The lack of a closing ‘%’ character defining the USERPROFILE variable name caused my failure.

It’s been a while since I’ve done in-depth work with Folder Redirection via GPO, but keep in mind that GPOs may set registry values as well. If you find this value periodically changing back, there may be a Local Policy or Group Policy ultimately (re)setting this value.

The Solution

The edugeek thread and I resolved our issues by finding which registry value(s) were malformed and correcting them.

WARNING: Obligatory warning that making changes in the Windows Registry has a possibility of bricking your computer if you do something wrong. Be careful, and consider taking Registry or computer-level backups first.

Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

Open Regedit, navigate to the “User Shell Folders” key, and review the data values for all of the registry entries listed. You will likely find one or more entries where the “%USERPROFILE%” variable is somehow malformed. Note the original value(s) and/or back up the registry, then fix the values as needed. Your issue should be resolved immediately without requiring a reboot or log out/in

Fatal error: Uncaught Error: Class ‘BBP_BuddyPress_Activity’ not found

Investigation

A client of mine wanted to disable the activity stream, went to Dashboard > Settings > BuddyPress > Components > Activity Streams, and Unticked the option. After they hit save, the site displayed the error ‘There has been a critical error on this website’ and the entire website (including admin dashboard) was unreachable/unusable (only returning this error). Under the hood, I found the error was “Fatal error: Uncaught Error: Class ‘BBP_BuddyPress_Activity’ not found”.

WordPress version: 5.7
bbPress Version 2.6.6

So I enabled debugging info in the wp-config.php file and received the full error (paths sanitized for security):

Fatal error: Uncaught Error: Class 'BBP_BuddyPress_Activity' not found in public_html/wp-content/plugins/bbpress/includes/extend/buddypress/loader.php:153 Stack trace:
 0 public_html/wp-includes/class-wp-hook.php(292): BBP_Forums_Component->setup_components('')
 1 public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
 2 public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
 3 public_html/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(267): do_action('bp_init')
 4 public_html/wp-includes/class-wp-hook.php(292): bp_init('')
 5 public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
 6 public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
 7 public_html/wp-settings.php(560): do_action('init')
 8 public_html/wp-co in public_html/wp-content/plugins/bbpress/includes/extend/buddypress/loader.php on line 153

Because of the last line, I checked Line 153 of loader.php (as referenced above), which brought me to the ‘setup_components()’ function. Line 153 is the ‘new BBP_BuddyPress_Activity() line.

    /**
     * Instantiate classes for BuddyPress integration
     *
     * @since 2.0.0 bbPress (r3395)
     */
    public function setup_components() {

            // Always load the members component
            bbpress()->extend->buddypress->members = new BBP_BuddyPress_Members();

            // Create new activity class
            if ( bp_is_active( 'activity' ) ) {
                    bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity();
            }

            // Register the group extension only if groups are active
            if ( bbp_is_group_forums_active() && bp_is_active( 'groups' ) ) {
                    bp_register_group_extension( 'BBP_Forums_Group_Extension' );
            }
    }

Resolution

From this, I was able to determine that bbPress thought the ‘Activity’ component was enabled, but for some reason did not have the ‘BBP_BuddyPress_Activity’ class loaded. I was able to temporarily resolve the issue by patching the ‘setup_components()’ function in the file ‘wp-content/plugins/bbpress/includes/extend/buddypress/loader.php’ with a few lines in order to manually include the ‘BBP_BuddyPress_Activity’ class if necessary:


                // Create new activity class
                if ( bp_is_active( 'activity' ) ) {
// Temporary patch!
if ( ! class_exists( 'BBP_BuddyPress_Activity' ) ){
require_once(dirname(__FILE__).'/activity.php');
}
                        bbpress()->extend->buddypress->activity = new BBP_BuddyPress_Activity();
                }

As I have patched a file within the plugin, it will be overwritten if any upgrades come out for the plugin. Because of that, I have opened a ticket in the bbPress Trac system to look for a final resolution that will survive plugin upgrades (hopefully through an update to the bbPress plugin itself).

0x800708ca This network connection does not exist

I was recently adding an additional mapped drive to an existing GPO, but the drive would not appear no matter what changes I made to the various settings (Create/Replace/Update, adding a Delete first, setting this or all drives to show, etc). Frustrated, I started digging into the event viewer and found this error:

0x800708ca This network connection does not exist

I searched online for this error and kept finding results where people were trying to get rid of existing mapped drives but were unable to. This was the opposite of what I was after! Finally I ran across a forum thread where one of the troubleshooting steps a user mentioned was to check for spaces in the drive description. I didn’t have any spaces in the drive description, but that got me thinking. A quick glance showed the functioning drives paths did *not* end with a trailing slash, but the failing drive mapping did (see following example). I removed the trailing slash, ran gpupdate on a computer, and the drive instantly appeared.

\\server\path\that\works
\\server\path\that\fails\