Reset “Hidden files and folders” to normal using PowerShell


posted by Aman Dhally
01-25-2012

Downloads: 59
File size: 694 B
Views: 297

Embed
Reset “Hidden files and folders” to normal using PowerShell
  1. <# 
  2. author: Aman Dhally 
  3. date: 25-Jan-2012 
  4. version: 1 
  5. Purpose: change the Attributes of "Hidden" folder to "Normal" 
  6. mail: amandhally@gmail.com 
  7. website: http://www.amandhally.net/blog 
  8.  
  9. blog: http://newdelhipowershellusergroup.blogspot.com/ 
  10.  
  11.             /^(o.o)^\  
  12.  
  13. more info: http://newdelhipowershellusergroup.blogspot.com/2012/01/script-to-reset-hidden-files-and.html  
  14.  
  15. #> 
  16.  
  17. ## Change "D:\P-temp" with your folder path  
  18.  
  19. $Filepath = Get-ChildItem -Recurse -path "D:\P-Temp\" -Force   
  20.  
  21. $HSfiles = $Filepath | where { $_.Attributes -match "Hidden"
  22.  
  23. $HSfiles 
  24.  
  25. foreach ( $Object in $HSfiles ) { 
  26.      
  27.      
  28.     $Object.Attributes = "Archive"  
  29.      
  30.      
  31.     
  32.  
  33. ### End of script ##### 

Hi,

yesterday one of my users laptop get infected with virus. After removal of virus i saw that “Virus” hide every file and folder in the laptop.  It was quite a pain to “Choose file and folder” right click on it, choose properties and un-tick the hidden option.

Then i decide to write a script which can do this for me.

More info : http://newdelhipowershellusergroup.blogspot.com/2012/01/script-to-reset-hidden-files-and.html

Thanks

Aman Dhally

Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.