I cant use Clear content command on Powershell

Anonymous
2024-02-20T18:52:21+00:00

I want to clear contents of the specific location in Program Files x86\steam.

My desired command aligns as:

clc –path C:"Program Files (x86)"\Steam\userdata[My Steam ID]\440\remote*

so the full console interface goes like:
PS C:\Program Files (x86)\Steam\userdata[My Steam ID]\440\remote> clc –path C:"Program Files (x86)"\Steam\userdata[My Steam ID]\440\remote*

However, the command keeps failing to be executed despite my considerations upon any possible reason.

Error message says:

clc : 'C:\Program Files (x86)\Steam\userdata[My Steam ID]\440\remote' 경로에 대한 액세스가 거부되었습니다.

위치 줄:1 문자:1 **The Korean sentence says: Access to the path is denied At line:1 char:1**

+ clc –path C:"Program Files (x86)"\Steam\userdata[My Steam ID]\440\remot ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*+ CategoryInfo          : PermissionDenied: (C:\Program File...[My Steam ID]\440\remote:String) [Clear-Content], UnauthorizedAccessException* 

*+ FullyQualifiedErrorId : ClearContentUnauthorizedAccessError,Microsoft.PowerShell.Commands.ClearContentCommand*

To resolve the problem, I already tried:

  1. Launching PowerShell as administrator then relocate the path via Set-Location –path C:"Program Files (x86)"\Steam\userdata[My Steam ID]\440\remote

2. Unrestricted execution policy via Set-ExecutionPolicy unrestricted (Then double checked if the new rule is still valid in different window)

  1. Ran control userpasswords2 and checked if I'm in the Administrator group
  2. Granting Program Files (x86) and its sub file's access and edit permission (means practically all permissions I can grant) to "Users" and "Administrators" directories via Properties-Security tab (Didn't tried granting same permissions to other user directories tho)

But status quo.

Please let me know if theres possible solution or anything else I should look into.

PS. WHY THE SCREENSHOT UPLOAD FUNCTION IS DEAD OMG THIS PLATFORM IS SO POORLY CONSTRUCTED I FAILED TO EVEN POST THIS VERY ARTICLE IN CHROME BROWSER

***moved from Windows / Windows 11 / Files, folders, and storage***

Windows for business | Windows Client for IT Pros | Performance | Windows desktop and shell experience

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Anonymous
    2024-02-21T03:51:37+00:00

    Try running your script as TrustedInstaller via PowerRun or AdvancedRun.

    P.S. To post a screenshot here, just copy and paste.

    0 comments No comments
  2. Anonymous
    2024-02-21T06:17:10+00:00

    Try running your script as TrustedInstaller via PowerRun or AdvancedRun.

    P.S. To post a screenshot here, just copy and paste.

    How can I run certain program with certain user directory?

    0 comments No comments
  3. Anonymous
    2024-02-21T06:32:14+00:00

    Try running your script as TrustedInstaller via PowerRun or AdvancedRun.

    P.S. To post a screenshot here, just copy and paste.

    How can I run certain program with certain user directory?

    Start up PowerRun and double-click the powershell.exe item shown in the PowerRun window. That will open a PowerShell window with TrustedInstaller access. Run your script from that window.

    0 comments No comments