Windows 10: Issue with "PermissionDenied" with PowerShell 5.1 running as Admin

Discus and support Issue with "PermissionDenied" with PowerShell 5.1 running as Admin in Windows 10 Customization to solve the problem; Hi, How do I modify or fix directories with a Mode of 'd--hsl' to allow the administrator to access? I'm using PowerShell 5.1 run as Administrator.... Discussion in 'Windows 10 Customization' started by Kelley28, Aug 26, 2019.

  1. Kelley28 Win User

    Issue with "PermissionDenied" with PowerShell 5.1 running as Admin


    Hi,

    How do I modify or fix directories with a Mode of 'd--hsl' to allow the administrator to access? I'm using PowerShell 5.1 run as Administrator.


    Mode LastWriteTime Length Name

    ---- ------------- ------ ----

    d--h-- 7/19/2019 5:05 PM AppData

    d--hsl 7/19/2019 5:05 PM Application Data

    d--hsl 7/19/2019 5:05 PM Cookies

    d--hs- 8/26/2019 5:01 PM IntelGraphicsProfiles

    d--hsl 7/19/2019 5:05 PM Local Settings

    d--h-- 12/18/2017 11:31 AM MicrosoftEdgeBackups

    d--hsl 7/19/2019 5:05 PM My Documents



    Thanks,

    Kelley28

    :)
     
    Kelley28, Aug 26, 2019
    #1
  2. Bree Win User

    running DOS as ADMIN


    I suggested that in post #4 but @bromberg doesn't seem to have tried it yet...
     
  3. Pattik Win User
    Running Powershell as admin


    To get around having to right click to run powershell as an admin...have you tried getting to powershell via the Task Manager? Open Task Manager via Ctl-Alt-Delete, then click on More details (if needed). From the File Menu, select Run new task. You can then click on the box that says "create this task with admin privileges", type powershell in the dialog box and enter. That eliminates the need to right click to run as an admin.
     
    Pattik, Aug 26, 2019
    #3
  4. djmcnz Win User

    Issue with "PermissionDenied" with PowerShell 5.1 running as Admin

    running DOS as ADMIN


    I assume you don't have 'exit' anywhere in your batch file?

    Rather than playing with 'pause' - if you want to see the output...

    1. Open a command window as admin
    2. Run the batch file manually
    3. Command window will not close unless the 'exit' command is issued
    4. Read output
    That's the first step I'd take to diagnose. Then run every line in your batch file manually, one-by-one, in your admin command window (copy and paste from the actual batch file, don't retype the commands).

    You'll soon find your problem.
     
    djmcnz, Aug 26, 2019
    #4
Thema:

Issue with "PermissionDenied" with PowerShell 5.1 running as Admin

Loading...
  1. Issue with "PermissionDenied" with PowerShell 5.1 running as Admin - Similar Threads - Issue PermissionDenied PowerShell

  2. PowerShell Admin and PowerShell is not working

    in Windows 10 Gaming
    PowerShell Admin and PowerShell is not working: I cannot use PowerShell anymore https://answers.microsoft.com/en-us/windows/forum/all/powershell-admin-and-powershell-is-not-working/5609d07f-3986-4c10-aee8-6f243bc7123b
  3. PowerShell Admin and PowerShell is not working

    in Windows 10 Software and Apps
    PowerShell Admin and PowerShell is not working: I cannot use PowerShell anymore https://answers.microsoft.com/en-us/windows/forum/all/powershell-admin-and-powershell-is-not-working/5609d07f-3986-4c10-aee8-6f243bc7123b
  4. PowerShell Admin and PowerShell is not working

    in Windows 10 BSOD Crashes and Debugging
    PowerShell Admin and PowerShell is not working: I cannot use PowerShell anymore https://answers.microsoft.com/en-us/windows/forum/all/powershell-admin-and-powershell-is-not-working/5609d07f-3986-4c10-aee8-6f243bc7123b
  5. Windows Powershell Admin

    in Windows 10 Software and Apps
    Windows Powershell Admin: i can't open Windows Powershell it's says that the app is not installed does anyone knows how to fix this https://answers.microsoft.com/en-us/windows/forum/all/windows-powershell-admin/c3c92fc2-cd09-45e2-b536-546a8d7594a7
  6. PowerShell 7 compatibility with PowerShell 5

    in Windows 10 Gaming
    PowerShell 7 compatibility with PowerShell 5: Hi just like to ask if a ps1 script written in PowerShell 7 can be used in PowerShell 5 without any issues? https://answers.microsoft.com/en-us/windows/forum/all/powershell-7-compatibility-with-powershell-5/cb95ea7c-070c-4f1f-8d48-6f68d95c2cb1
  7. PowerShell 7 compatibility with PowerShell 5

    in Windows 10 Software and Apps
    PowerShell 7 compatibility with PowerShell 5: Hi just like to ask if a ps1 script written in PowerShell 7 can be used in PowerShell 5 without any issues? https://answers.microsoft.com/en-us/windows/forum/all/powershell-7-compatibility-with-powershell-5/cb95ea7c-070c-4f1f-8d48-6f68d95c2cb1
  8. PowerShell 7 compatibility with PowerShell 5

    in Windows 10 Customization
    PowerShell 7 compatibility with PowerShell 5: Hi just like to ask if a ps1 script written in PowerShell 7 can be used in PowerShell 5 without any issues? https://answers.microsoft.com/en-us/windows/forum/all/powershell-7-compatibility-with-powershell-5/cb95ea7c-070c-4f1f-8d48-6f68d95c2cb1
  9. PowerShell file run with admin rights

    in Windows 10 Support
    PowerShell file run with admin rights: I made a script in PowerShell and I have to run with admin rights. I also made a shortcut of that file and with right click -> properties, shortcut tab -> advanced -> run as admin is disabled. How can I run a ps1. file (PowerShell file) with admin rights ? (see picture) 182480
  10. Powershell/Powershell admin missing

    in Windows 10 BSOD Crashes and Debugging
    Powershell/Powershell admin missing: When finding a solution to remove skype today I came across a post here where the solution was found to use a powershell command. So I went to open it up and found out it was missing. I looked into it and found some other people with a similar problem, and they went to check...