0

I am having trouble with Windows 10 app store and related app since a Windows restore. For troubleshooting purpose, I want to rename the "c:\program files\windowsapps". A process is preventing me from doing so. Since PowerShell usually point out what process is preventing you from doing an action, i thought about using it.

get-childitem -hidden -filter "WindowsApps" | Rename-Item -Newname {$_.name -replace "WindowsApps", "WindowsApps.Old"}

I don't get any error, yet the folder has not been renamed. I ran PowerShell as administrator to prevent access problem. I am sure the command is right, since I used it in other folder.

Is there an other way to do this or is something missing in my code ?

Alexander Obersht
  • 3,215
  • 2
  • 22
  • 26
Inotox
  • 3
  • 4
  • 2
    possible duplicate of [Powershell script to check application that's locking a file?](http://stackoverflow.com/questions/958123/powershell-script-to-check-application-thats-locking-a-file) – Bacon Bits Sep 27 '15 at 13:34
  • You can use [this](http://stackoverflow.com/questions/24992681/powershell-check-if-a-file-is-locked) to test if a file is locked, but as far as I know you have to use Win32 calls to enumerate open handles on a file. – Bacon Bits Sep 27 '15 at 13:34
  • Not getting any error message suggest other issues (possibly in addition to the folder being locked by a process). Do you run `Get-ChildItem` on the correct location? You could add `-Path "c:\program files\windowsapps"` switch to be sure. – Alexander Obersht Sep 27 '15 at 13:39
  • When you only execute `get-childitem -hidden -filter "WindowsApps"` is the folder returned? – Patrick Sep 27 '15 at 13:49

0 Answers0