issue with deleting duplicate Desktop folder

Page 4 of 6 FirstFirst ... 23456 LastLast

  1. Posts : 989
    Microsoft Windows 10 Home
       #31

    This PowerShell will summarize the targets of the folders under This PC:
    Code:
    $Shell     = New-Object -ComObject shell.application
    $shell.NameSpace(17).Items() | Where Type -eq 'System Folder' | select name , path
    Sample OUtput:
    Code:
    PS C:\> $shell.NameSpace(17).Items() | Where Type -eq 'System Folder' | select name , path
    
    Name      Path
    ----      ----
    Downloads C:\Users\keith\Downloads
    Pictures  C:\Users\keith\Pictures
    Music     C:\Users\keith\Music
    Desktop   C:\Users\keith\Desktop
    Documents C:\Users\keith\Documents
    Videos    C:\Users\keith\Videos
    and this will give you a little more info:
    Code:
    $Shell     = New-Object -ComObject shell.application
    $FD        = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions'
    $ThisPC_ID = '{20D04FE0-3AEA-1069-A2D8-08002B30309D}\'
    
    gci $fd -pv pvKey | gp | ? Category -eq 4 | ? ParsingName -like "*$ThisPC_ID*" | %{
        $oFolder        = $shell.Namespace($_.ParsingName)
        Try {
            $PCPolicy = $pvKey.OpenSubKey('PropertyBag').GetValue('ThisPCPolicy')
        } Catch {
            $PCPolicy = 'None'
        } 
        [PSCustomObject]@{
            'Name'            = $oFolder.Title
            'Path'            = $oFolder.Self.Path
            'KnownFolderName' = $_.Name
            'ThisPCPolicy'    = $PCPolicy
            'KnownFolderID'   = $_.PSChildName
        }
    }  | Sort ThisPCPolicy  -Descending | Out-GridView
    Sample Output:
    issue with deleting duplicate Desktop folder-screenshot-937-.png

    Some of his information may be buried in all these "wall-of-Text" replies, but I'm not wasting what little vision I have left looking for it.
    Last edited by KeithM; 24 Mar 2021 at 00:11.
      My Computer


  2. Posts : 14
    Win 10
       #32

    Resolved duplicate system folder issue


    Denis,
    I apologize for taking so long to respond. I went through each suggested step. 1 - I agree with finding the address being easier your way, and will look into changing that. 2 - I put the system files into the Quick access column as you suggested, but actually after I completed step 3. I removed the "desktop" system folder per the instructions, and found that I had a second desktop sys folder still--the one with the downloads arrow as an icon. I ran the removal program a second time, but it would not remove it. My feelings are that I now have just one functioning desktop sys folder, but only with the wrong icon. I tried to change it, but there was no option in Properties. This takes care of step 5 - I did the same with the downloads sys folder and removed and reinstalled it, just in case the desktop and downloads folders were connected somehow. It restored the correct downloads sys folder in the Users folder and it let me put it in the Quick access bar, but, oddly enough, it wouldn't show up in This PC. Really, not a problem. Yes, in Properties, it has a Locations tab that leads me back to the Users folder. I've never in 30 years of working with netbooks, laptops, and PC's had this problem. Odd. I'm good with this fix thus far and maybe will look into getting that icon fixed. Thank you immensely for helping me get rid of the double desktop folder. That was confusing. Thanks again. Cindi
    KeithM,
    With all of the things that Denis had me try and what you see that I am left with now, do you have and suggestions for my one remaining issue of the downloads icon on the desktop folder? If not, please accept my sincere gratitude for your suggestions and time. This was one I'd never experienced before. Thank you very much. Cindi
    Attached Thumbnails Attached Thumbnails issue with deleting duplicate Desktop folder-screenshot-2021-03-23-191446.png  
      My Computer


  3. Posts : 989
    Microsoft Windows 10 Home
       #33

    Have you tried any of the PowerShell I posted to gather info? All you have to do is copy & paste & press Enter. If you've ever typed dir at a Command Prompt, you can use PowerShell.

    Because with just that screenshot, all I can tell is that one folder is missing from This PC. Is that intentional?

    If you're still relucant to try PowerShell, please at least copy and paste the following two commands into the Explorer Address bar or a Run dialog. Using these commands ensures you're opening the "official" folder, regardless of the name displayed or icon:
    • shell:ThisPCDesktopFolder
    • shell:Downloads


    Christ on a crutch! I just realized there are two different people posting problems on this thread --- no wonder it's been confusing.

    I've posted various PowerShell snippets that will gather infromation to untangle these things. Please run that & post back with the info those provide.
      My Computer


  4. Posts : 915
    Windows 10 Pro 64bit 22H2 19045.3324
       #34

    KeithM said:
    I've posted various PowerShell snippets that will gather infromation to untangle these things..
    @KeithM I noticed your snippet is missing an apostrophe after KnownFolderID. I've added it here in the code block below. I really appreciated finding out about this Out-GridView Powershell format option, thanks!



    Code:
    $Shell     = New-Object -ComObject shell.application
    $FD        = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions'
    $ThisPC_ID = '{20D04FE0-3AEA-1069-A2D8-08002B30309D}\'
    
    gci $fd -pv pvKey | gp | ? Category -eq 4 | ? ParsingName -like "*$ThisPC_ID*" | %{
        $oFolder        = $shell.Namespace($_.ParsingName)
        Try {
            $PCPolicy = $pvKey.OpenSubKey('PropertyBag').GetValue('ThisPCPolicy')
        } Catch {
            $PCPolicy = 'None'
        } 
        [PSCustomObject]@{
            'Name'            = $oFolder.Title
            'Path'            = $oFolder.Self.Path
            'KnownFolderName' = $_.Name
            'ThisPCPolicy'    = $PCPolicy
            'KnownFolderID'    = $_.PSChildName
        }
    }  | Sort ThisPCPolicy  -Descending | Out-GridView
      My Computers


  5. Posts : 989
    Microsoft Windows 10 Home
       #35

    Thanks for catching that, I try like hell to proofread and the code was tested, But I'm going blind and editing at high zoom levels can be tricky. I've edited the original now.

    Out-Gridview is great. You can sort & filter, and if you add the -PassThru parameter, it becomes a selection control, passing selected object on down teh pipeline. I written a couple of small utilities that utilize it.

    This one, ( run from Admin if you want to modify HKLM entries) lets you quickly show or hide items in the Navigation Pane by toggling the System.IsPinnedToNameSpaceTree value.
    issue with deleting duplicate Desktop folder-screenshot-948-.png

    Code:
    #########################################################################################
    #
    #       Presents the user with a GridView control listing items that appear (or can appear)
    #   in the Navigatgion Pane & allows the user to select items to toggle their visibility.
    #
    #            To modify any items under the HKLM hive, the script should be run
    #        from an **Administrator** PowerShell window.
    #########################################################################################
    
    $GridTitle   = 'Select Item(s) to toggle Namespace pin ( 1 = Visible in Navigation Pane )'
    $Pinned      = 'System.IsPinnedToNamespaceTree'
    $Hives       = @( 'HKCU:','HKLM:' )
    $DTNSPath    = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\'
    $CLSIDPath   = 'SOFTWARE\Classes\CLSID'
    $sbFilter    = [ScriptBlock]::Create( '($DTNSIDs -match $_.PSChildName) -and ($_.Property -contains $Pinned)' )
    
    $DTNSIDs     = ( Get-ChildItem ( Join-Path $Hives $DTNSPath )).PSPath -notMatch 'DelegateFolders$'
    
    Get-ChildItem ( Join-Path $Hives $CLSIDPath ) | Where $sbFilter | ForEach {
        $ID = $_.PSChildName
        [PSCustomObject]@{
            'IsPinned' = $_.GetValue( $Pinned )
            'CLSID'    = $ID
            'Name'     = $Shell.NameSpace( "shell:::$ID" ).Title
            'Path'     = $Shell.NameSpace( "shell:::$ID" ).Self.Path
            'Hive'     = $_.Name.Split('\')[0]
            'Self'     = $_
        }
    } | Sort CLSID | Out-GridView -Title $GridTitle -PassThru | ForEach {
            Set-ItemProperty -Path $_.Self.PSPath -Name $Pinned -Value ([Int](! $_.IsPinned)) -Force -PassThru
    }



    This one toggles the visibility of Power Options in the Advanced dialog ( Also fequires Admin privilege ) :

    issue with deleting duplicate Desktop folder-screenshot-947-.png
    Code:
    Function Toggle-PowerSettingsVisibility {
        $Title         = 'Select option(s) to toggle visibility'
        $PowerSettings = 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings'
        @( [PSCustomObject]@{
                Attributes  = 0
                PSChildName = '{ -- No Changes -- }'
                Name        = ' "Safety" row to clear selection'
        } ) +
        @( Get-ChildItem $PowerSettings -Recurse | ? Property -contains 'Attributes' | Get-ItemProperty |
            Select Attributes, PSCHildName,
                   @{ N = 'Name' ; E = { $_.FriendlyName.Split(',')[-1] }} ) | Sort PSChildName |
        Out-GridView -Passthru -Title $Title | ForEach {
            $Splat = @{
                Path  = Resolve-Path "$PowerSettings\*\$($_.PSChildName)"
                Name  = 'Attributes'
                Value = [Int]( -not $_.Attributes )
            }
            Set-ItemProperty @Splat
        }
    }
    Toggle-PowerSettingsVisibility



    And this one toggles the Show/Hide state of the folders under This PC. You can play witht he duplicate folders!

    issue with deleting duplicate Desktop folder-screenshot-946-.png

    Code:
    Function Toggle-ThisPCFolders {
        $FolderDesc  = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions'
        $Title       = 'Select folder(s) to toggle its visibility'
        $ToggleState = @{ Show = 'Hide' ; Hide = 'Show' }
    
        Get-ChildItem $FolderDesc  | Get-ItemProperty | Where name -match '3D|Local [^A]|My |ThisPC|Personal|[ ^]Downloads' |
            Select Name, @{ N = 'View State' ; E = {
                ( Get-ItemProperty -path ( join-path $_.PSpath PropertyBag ) ).ThisPCPolicy
            }}, PSPath |
        Out-GridView -Title $Title -Passthru | ForEach {
            $PropBagPath = Join-Path $_.PSPath PropertyBag
            If ( Test-Path $PropBagPath ) {
                Set-ItemProperty $PropBagPath ThisPCPolicy -Value $ToggleState[( Get-ItemProperty $PropBagPath ).ThisPCPolicy]
            } Else {
                mkdir $PropBagPath | out-null
                New-ItemProperty $PropBagPath ThisPCPolicy -Value Hide | out-null
            }
        }
        gps explorer | spps
    }
    Toggle-ThisPCFolders
      My Computer


  6. Posts : 915
    Windows 10 Pro 64bit 22H2 19045.3324
       #36

    KeithM said:
    But I'm going blind and editing at high zoom levels can be tricky.
    ... tell me about it.. ;o/

    Glad to add an assist. In my old cubical days I use to say, 'You know the easiest way to find a TypeO - make a 100 copies.'

    Thanks for introducing these other Powershell options.
      My Computers


  7. Posts : 16,783
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #37

    Cindi,

    Ken Cindi G said:
    … system files … system folder … sys folder
    No. User folder(s)

    Ken Cindi G said:
    2 - I put the system files into the Quick access column as you suggested
    2 And I can see in your diagram that you have put Documents, Desktop & Pictures there. It is entirely up to you but, since this discussion has been about your C:\Users\%UserName%\Downloads folder, I was surprised to see that you had not dragged that to Quick access as well.
    - Oh, I see lower down in your post that you have done so but must have taken that screen picture beforehand.

    Ken Cindi G said:
    put it in the Quick access bar, but,oddly enough, it wouldn't show up in This PC
    That's not odd. I suggested use of Quick access as a workaround precisely because you might not have resolved the problem of what gets shown in ThisPC.

    Ken Cindi G said:
    [This takes care of step 5 - I did the same with the downloads sys folder and removed and reinstalled it
    You are going to be lucky not to have made things worse with that deletion. You should never delete a user folder. You should only ever relocate it.
    Ken Cindi G said:
    Yes, in Properties, it has a Locations tab that leads me back to the Users folder
    You did not check what I suggested. You checked your Desktop folder instead.
    Please go to C:\Users\%UserName%\Downloads, right click on it & select Properties. The Properties dialog should have a Location tab in it. Does yours? If so, what location [address/path] does it show?
    - If there is no location tab, repeat the steps at post #21 to display all the user folder paths in the Registry.
    - This time, please follow the instructions to widen the columns so the whole of the text can be seen. You can maximise the RegEdit window as well then just crop the diagrams to cut out blank / irrelevant areas to make them easier to read in your posts.

    In future posts, please limit each paragraph to one topic. Start new topics in new paragraphs. It makes posts far, far easier to understand.

    All the best,
    Denis
      My Computer


  8. Posts : 14
    Win 10
       #38

    Change icon on Desktop This PC folder


    KeithM
    I wanted to thank you for all of the posts and suggestions you have made. I wanted to try the fixes that I felt the most comfortable with first. I did finally try a PowerShell to get information to you. See snip below. (I have changed the settings multiple times and even shrunk the image down to a smaller jpeg, but the "insert image" option isn't working for me on TenForums. I apologize for having to put all of my images as attachments below.)
    Snip 1) dir
    Snips 2&3)
    $Shell = New-Object -ComObject shell.application
    $FD = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions'
    $ThisPC_ID = '{20D04FE0-3AEA-1069-A2D8-08002B30309D}\'

    gci $fd -pv pvKey | gp | ? Category -eq 4 | ? ParsingName -like "*$ThisPC_ID*" | %{
    $oFolder = $shell.Namespace($_.ParsingName)
    Try {
    $PCPolicy = $pvKey.OpenSubKey('PropertyBag').GetValue('ThisPCPolicy')
    } Catch {
    $PCPolicy = 'None'
    }
    [PSCustomObject]@{
    'Name' = $oFolder.Title
    'Path' = $oFolder.Self.Path
    'KnownFolderName' = $_.Name
    'ThisPCPolicy' = $PCPolicy
    'KnownFolderID' = $_.PSChildName
    }
    } | Sort ThisPCPolicy -Descending | Out-GridView


    Snip 4) shell:ThisPCDesktopFolder
    Snip 5) shellownloads

    I hope that these are in the correct order and clear enough to view. Thank you again in advance for you patience and effort. I am also blind in one eye from a stroke, and it really slows down working on issues such as these. Thanks Keith!
    Attached Thumbnails Attached Thumbnails issue with deleting duplicate Desktop folder-screenshot-2021-03-25-1853049.png   issue with deleting duplicate Desktop folder-screenshot-2021-03-25-161453.png   issue with deleting duplicate Desktop folder-screenshot-2021-03-25-163056.png   issue with deleting duplicate Desktop folder-screenshot-2021-03-25-183348.png   issue with deleting duplicate Desktop folder-screenshot-2021-03-25-162428.png  

      My Computer


  9. Posts : 989
    Microsoft Windows 10 Home
       #39

    All those black screens with errors are because you tried to run PowerShell code in a Command PRompt window --- They're both terminal-stle windows, but they are diffferent.

    Try clicking the Start icon & typing PowerShell

    issue with deleting duplicate Desktop folder-image.png

    When a PowerShell window appears, it looks like this (ignore my custom prompt) :
    issue with deleting duplicate Desktop folder-screenshot-957-.png


    Other than that, from the Address bar in yuor other screenshots, it looks like the folder under This PC is your Desktop folder & the Downloads folder has been removed or hidden from This PC, was that something Denis had you do?

    Hope you find PowerShell and have better luck with the code.
      My Computer


  10. Posts : 14
    Win 10
       #40

    Duplicate Desktop folder resolved, but still has a Downloads icon


    Hi Denis,

    I apologize for the delay. Life gets in the way sometimes. I wanted to respond to your last post.


    Ken Cindi G said:
    … system files … system folder … sys folder

    No. User folder(s)


    Denis, thank you for clarifying. I was using a shortcut term, but should have said User folders.






    Ken Cindi G said:
    put it in the Quick access bar, but,oddly enough, it wouldn't show up in This PC


    That's not odd. I suggested use of Quick access as a workaround precisely because you might not have resolved the problem of what gets shown in ThisPC.

    Thank you Denis, it is a good temporary work around. I just wanted to make sure that it was still a known problem that the Downloads folder wasn't showing up in ThisPC yet. I understood your intent.
    Just some extra information about that Downloads folder, it kept appearing and disappearing from the Users folder, which caused me to think that I might have a corrupt file problem. I ran SFC and the report came back stating that it had fixed a corrupt file issue. The Downloads folder stopped disappearing and reappearing in the Users folder after that.






    Ken Cindi G said:
    [This takes care of step 5 - I did the same with the downloads sys folder and removed and reinstalled it


    You are going to be lucky not to have made things worse with that deletion. You should never delete a user folder. You should only ever relocate it.


    Denis, I apologize for any confusion, but this was done at your suggestion. If you remember this from your post below. I probably didn't make myself clear when I said that I "I removed the "desktop" system folder per the instructions", and also the Downloads folder. What I meant was that I followed the link that you provided for Adding/Removing Folders and it worked as far as deleting the "extra" Desktop folder. The remaining issue is that the Desktop folder still has a Downloads icon.

    "3 The proper solution.

    - I have no more suggestions to offer but KeithM might well have.
    - Because I ditched those ThisPC entries years ago, I have no useful experience of resolving problems with them.
    - I think that my earlier suggestion is worth a try but cannot be certain that it will help."

    Try3 said:
    What I suggest is that you remove them all and then, assuming that you want them there, put them all back again. The act of putting them back might restore them to their proper values.
    Add or Remove Folders from This PC - TenForumsTutorials [Its Method 1 seems, to me, to be the more appropriate choice]So what I am suggesting is that you
    Remove Folders from This PC
    and then
    Add Folders from This PC.







    Ken Cindi G said:
    Yes, in Properties, it has a Locations tab that leads me back to the Users folder


    You did not check what I suggested. You checked your Desktop folder instead.
    Please go to C:\Users\%UserName%\Downloads, right click on it & select Properties. The Properties dialog should have a Location tab in it. Does yours? If so, what location [address/path] does it show?
    - If there is no location tab, repeat the steps at post #21 to display all the user folder paths in the Registry.


    Denis, I checked the Downloads folder, right clicked, and selected Properties. It does have a Location tab, which does direct me back to the User folder with all of the rest of the System files in it. I think we are good there.

    I did find a help forum that successfully guided me to add a Customize Tab--which was missing. I clicked to change the icon, but it shows that I already have the correct icon, so I can't change it using the suggested method by Microsoft.

    Thank you again for your help. It seems that this fix is not as straight forward as we thought originally, since the Downloads folder was corrupted to some degree. I hope that my formatting above made my post more understandable and easier to read. I greatly appreciate your help. Cindi






    - - - Updated - - -

    Keith,
    Thank you for the clarification about PowerShell. No, I had not used PowerShell before. I found it though and you can see the results in the snip below. Thank you immensely for your patience in with this issue.




    Your second question:

    "Other than that, from the Address bar in your other screenshots, it looks like the folder under This PC is your Desktop folder & the Downloads folder has been removed or hidden from This PC, was that something Denis had you do?"

    No, it has been a problem from the beginning. We have just been focusing on one problem at a time. I have been stating regularly that the Downloads folder isn't showing up in ThisPC. SFC found a corrupted file with the Downloads folder, and it now has stopped appearing and disappearing in the Users folder, but is still missing from the ThisPC. Thank you again in advance for anything that you can see that can be done to fix either of my remaining issues.
    Attached Thumbnails Attached Thumbnails issue with deleting duplicate Desktop folder-screenshot-2021-03-29-182218.png  
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 14:19.
Find Us




Windows 10 Forums