0

a while ago my antivirus (360 total security free version) for some reason flagged the powershell as a virus or something and modified its settings. If I remember correctly it quarantined some file from the powershell. I restored the file and deleted that antivirus but to no avail, since the antivirus modified the powershell, every time I start up my PC the powershell pops up from the task bar with the message below:

Copy-Item : Access to the path 'C:\Windows\system32\powershell.exe' is denied.
At line:1 char:1
+ Copy-Item $Langvejsfra23 -Destination $tyngdepunkt -Recurse -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (C:\Windows\SysW...\powershell.exe:FileInfo) [Copy-Item], Unauthorized
   AccessException
    + FullyQualifiedErrorId : CopyFileInfoItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.CopyItemCommand

Copy-Item : Access to the path 'C:\Windows\system32\powershell.exe' is denied.
At line:1 char:1
+ Copy-Item $Langvejsfra23 -Destination $tyngdepunkt -Recurse -Force
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-Item], UnauthorizedAccessException
    + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.CopyItemCommand

Once the message pops up I just close it and start to use the computer normally. This issue itself doesn't interfere with anything on the pc, it works smoothly and without any problems. But it's just annoying getting this same message over and over again every time I start up my PC. Can someone please suggest what should I do to grant the powershell the permission to access the path it needs on startup?

I tried restoring the quarantined file to its original folder and deleted the antivirus but the issue persists. Now I just use the default Windows Defender.

1 Answer 1

0

Try to install .NET Framework 4.8.1 https://dotnet.microsoft.com/en-us/download/dotnet-framework/net481

Try to turn on/off the component:

To disable Windows PowerShell, type the command line:

DISM /online /Disable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root"

To enable Windows PowerShell again, type the command line:

DISM /online /Enable-Feature /FeatureName:"MicrosoftWindowsPowerShellV2Root"

Reboot

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.