Tech Community Live: Microsoft Intune
Oct 01 2024, 07:30 AM - 11:30 AM (PDT)
Microsoft Tech Community

Accidentally Modified Attributes of C:\Users\Username\AppData Folder - Worried About the Consequence

Copper Contributor

I attempted to sync an entire folder, including all its subfolders and files, with Google Drive for backup. When this didn't work, I decided to un-hide the hidden content. By right-clicking on the AppData folder and un-checking the "Hidden" attribute box, I initiated the process. However, I encountered error messages indicating that I lacked the necessary permissions to change the attributes of certain XML and other files. Opting to "Skip All," I allowed the process to continue.

 

As a result, some files within the "Local" subfolder remain hidden, while most are now unhidden. No files were deleted during this process; I simply attempted to change the attributes from hidden to unhidden. To restore all files in the AppData folder to their original state, I am considering using "dism /online /cleanup-image /restorehealth" followed by "sfc /scannow." 

 

In addition, I have written a PowerShell script to identify any remaining hidden files within the specified folder path:

 

```powershell

# Define the folder path to check

$folderPath = "C:\YourFolderPathHere"

 

# Get all files and subfolders within the specified folder

$items = Get-ChildItem -Path $folderPath -Recurse

 

# Check if any item is not hidden

$notHidden = $items | Where-Object { -not $_.Attributes.HasFlag([System.IO.FileAttributes]::Hidden) }

 

if ($notHidden -eq $null) {

    Write-Output "All files and subfolders within $folderPath are hidden."

} else {

    Write-Output "Some files or subfolders within $folderPath are not hidden."

    $notHidden | Select-Object FullName

}

```

1 Reply

@JameHernandez 

 

Hi,
If the only consequence is about hidden files that are now visible, that does not matter 😉 it's mainly a way to hide some files in Explorer or from 'dir'. That's it. Just hide AppData (or not if you prefer).
Dont use sfc or dism, it won't help. (well sfc wouldn't hurt).

 

For info I have 1474 files and folders hidden out of... 590529 in AppData 😉