Windows 10: Attempting to set hidden attribute to start menu folders via cmd Solved

  1.    25 Dec 2016 #1

    Attempting to set hidden attribute to start menu folders via cmd


    Ok, so I've been working on my unattended install and I am hitting a wall. I currently am using classic shell start menu to replace the original and I want to set the default start menu folders to hidden for two reasons. First reason being that I already have links for each of these located in classic start menu and don't need a second set sitting in my programs folder. Second reason, if I delete them(which doesn't work either), windows updates like to replace a few of these every now and then.

    Here is what I'm attempting to do via .bat file:

    Code:
    takeown /f "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Maintenance" /r /d y > NUL 2>&1
    icacls "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Maintenance" /grant administrators:F /t > NUL 2>&1
    takeown /f "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Accessories" /r /d y > NUL 2>&1
    icacls "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Accessories" /grant administrators:F /t > NUL 2>&1
    takeown /f "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Administrative Tools" /r /d y > NUL 2>&1
    icacls "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Administrative Tools" /grant administrators:F /t > NUL 2>&1
    takeown /f "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Ease of Access" /r /d y > NUL 2>&1
    icacls "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Ease of Access" /grant administrators:F /t > NUL 2>&1
    takeown /f "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows System" /r /d y > NUL 2>&1
    icacls "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows System" /grant administrators:F /t > NUL 2>&1
    attrib +H "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Maintenance" > NUL 2>&1
    attrib +H "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Accessories" > NUL 2>&1
    attrib +H "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Administrative Tools" > NUL 2>&1
    attrib +H "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows Ease of Access" > NUL 2>&1
    attrib +H "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Windows System" > NUL 2>&1
    takeown /f "%appdata%\Microsoft\Windows\Start Menu\Programs\Maintenance" /r /d y > NUL 2>&1
    icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Maintenance" /grant administrators:F /t > NUL 2>&1
    takeown /f "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Accessories" /r /d y > NUL 2>&1
    icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Accessories" /grant administrators:F /t > NUL 2>&1
    takeown /f "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Administrative Tools" /r /d y > NUL 2>&1
    icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Administrative Tools" /grant administrators:F /t > NUL 2>&1
    takeown /f "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Ease of Access" /r /d y > NUL 2>&1
    icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Ease of Access" /grant administrators:F /t > NUL 2>&1
    takeown /f "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell" /r /d y > NUL 2>&1
    icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell" /grant administrators:F /t > NUL 2>&1
    takeown /f "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows System" /r /d y > NUL 2>&1
    icacls "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows System" /grant administrators:F /t > NUL 2>&1
    attrib +H "%appdata%\Microsoft\Windows\Start Menu\Programs\Maintenance" > NUL 2>&1
    attrib +H "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Accessories" > NUL 2>&1
    attrib +H "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Administrative Tools" > NUL 2>&1
    attrib +H "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows Ease of Access" > NUL 2>&1
    attrib +H "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell" > NUL 2>&1
    attrib +H "%appdata%\Microsoft\Windows\Start Menu\Programs\Windows System" > NUL 2>&1
    I verified that takeown and icacls are returning successfully, but the ONLY folder this works on is the Maintenance folder from both the programdata and appdata locations. The rest of the folders not only persist, but if I try to delete them via explorer I receive a pop up saying I need admin access, click ok and it deletes. So obviously something is preventing or retaking ownership of the folders??

    The account is an admin with UAC disabled and the bat file uses an auto-elevation to run as administrator, so I know that rights are fine. Any help would be appreciated. Open to use cmd, powershell, or even a 3rd party program as long as I can run it in a portable solution.
      My ComputerSystem Spec

  2.    26 Dec 2016 #2

    Ok, so I found out how to set hidden attributes via powershell using this command:

    Code:
    (Get-Item “Folder Path”).Attributes = ‘Hidden’
    When I use this code it works successfully on the Maintenance folder, but any of the others error out saying that the directory doesn't exist. What am I missing here?
      My ComputerSystem Spec

  3.    27 Dec 2016 #3

    So for whatever reason, when viewing in explorer those folders are named as I have them in my bat file. If I open cmd and go into the directory and get the listing, the folders have a different name. I have changed my bat file to match the folder names found through cmd and everything works as it should. Now I'm left with 2 unimportant questions:

    1. Why did the takeown and icacls return as successful for folders that aren't there?
    2. Does it have to do with those folders being linked together, like a library maybe?
      My ComputerSystem Spec


 

Related Threads
Hi all, In win 7 I was able to put folders and shortcuts on the desktop (or every indexed folder) and when I went to: - START - SEARCH I was able to write a folder or shorcut or even a portion of them and Win 7 gave me immediately the...
Account Sign-In Hidden from Sign-in Menu/Start Menu in User Accounts and Family Safety
My younger brother and I share a computer. It is Windows 10 Pro. I was letting him use it while i was asleep. All I know is that he was playing his video games. Anyways, he left the house to go hang out somewhere and i wake up to see that when i...
Sorry this is kind of hard to explain. On Windows 7 start menu you could have a folder such as EA Games and then sub folders within. For example a folder for tiger woods golf, a folder for say Fifa and so on. It seems on Windows 10 you can only have...
Folders on Start Menu in Customization
Hi, Last question on customizing Windows 10 :) Settings > Personalization > Start > Choose which folder appear on Start I need to enable ONLY the following ones: File Explorer Settings Documents Downloads Personal Folder
I would like to organize my All Apps portion of the start menu in W10 as I did in W7. So far I have not figured out how to do this. There are a couple of problems. 1. Some programs just do not appear. I have one folder containing 3 shtcts. 2...
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 08:57.
Find Us