Get-acl on system file not working

This topic contains 7 replies, has 5 voices, and was last updated by Profile photo of Max Kozlov Max Kozlov 1 year, 7 months ago.

  • Author
  • #32541
    Profile photo of ertuu85

    Hello, I'm trying to do a

    get-acl c:\windows\system32\winload.exe

    but it's returning with

    Get-Acl : Cannot find path 'C:\Windows\system32\winload.exe' because it does not exist.
    At line:1 char:8
    + Get-Acl < <<<  C:\Windows\system32\winload.exe
        + CategoryInfo          : ObjectNotFound: (:) [Get-Acl], ItemNotFoundException
        + FullyQualifiedErrorId : GetAcl_PathNotFound_Exception,Microsoft.PowerShell.Commands.GetAclCommand

    The file does certainly exist in that location, i'm not sure why it's not working. I am also not able to do a test-path to it

  • #32542
    Profile photo of Mark Hammonds
    Mark Hammonds

    verify the file exist. is the file hidden?

  • #32563
    Profile photo of ertuu85

    Verified file does exist, I am looking at it in through explorer.

    I have unchecked show hidden files/show protected system files

    Tested on my windows 7 VM

  • #32564
    Profile photo of ertuu85

    Just tested this on Windows 2008 R2 without any issue...peculiar...I'll just assume my VM is acting up...thanks Mark for your help!

  • #32631
    Profile photo of Sander van den Hoed
    Sander van den Hoed

    What is the version of your powershell?

  • #32635
    Profile photo of ertuu85

    v2, but after trying the exact command on co-worker's win7 VM it works just fine...

    I'm assuming it's my VM as it's doing a few odd things with powershell and get-acl

  • #32668
    Profile photo of Mike Eyler
    Mike Eyler

    Try putting the path in quotes:
    get-acl "c:\windows\system32\winload.exe"

    Try this so you can read the full output.
    get-acl "c:\windows\system32\winload.exe" | Format-Table -Wrap -AutoSize

  • #32675
    Profile photo of Max Kozlov
    Max Kozlov

    Verify if your file in this location exactly:

    * test if it located in C:\Windows\SysWOW64 if you run x32 PS version

    * test if it exists when you run PS in admin mode
    user mode explorer can show that your file in
    but actually it located in

You must be logged in to reply to this topic.