Changing the Owner of Windows PowerShell folder from TrustedInstaller

Page 1 of 2 12 LastLast

  1. Posts : 116
    Win 10 Pro 64-bit
       #1

    Changing Owner of Windows PowerShell shortcuts folder


    I recently purchased a Dell XPS 8940 desktop and installed Windows version 20H2 on it. After copying the "Windows PowerShell" folder---because Windows wouldn't let me move the original---so that I could move the copy to a new user folder of my choice, I have the original "Windows PowerShell" folder still on my desktop.

    Though my _copy_ of the "Windows PowerShell" folder has the usual sort of permissions (SYSTEM, users, Administrators), the _original_ folder's permissions are special ones, such as "ALL APPLICATION PACKAGES", "ALL RESTRICTED APPLICATION PACKAGES", and "TrustedInstaller", which is also the Owner.

    In the past, after making a copy with normal permissions, I've somehow successfully deleted this original "Windows PowerShell" folder, and I'd like to delete it again now, but first I have the following questions:

    • Although I've not experienced any trouble in the past from doing it, is it a bad idea to delete the original "Windows PowerShell" folder, which has those special permissions entries and the TrustedInstaller as the Owner?
    • If it's OK to delete the original "Windows PowerShell" folder, would the best way to do that be to take ownership of it, away from TrustedInstaller? I've tried deleting it in the usual way, but despite the fact that I'm an Admin account, Windows is preventing me ("Folder Access Denied") from doing it, and I'm unable to change any of the permissions in the usual way that would enable me to delete it.


    Thanks for any advice.

    UPDATE MAR 30 :
    I'm talking about the folder with the Windows shortcuts.
    Last edited by devnull; 3 Weeks Ago at 07:42.
      My Computers

  2. zebal's Avatar
    Posts : 908
    Windows 10 Pro x64 20H2 (Build: 19042.867)
       #2

    devnull said:
    so that I could move the copy to a new user folder of my choice, I have the original "Windows PowerShell" folder still on my desktop.
    You are talking about C:\Program Files\WindowsPowerShell, not WindowsPowerShell in your documents folder?

    What's you're trying to do is nonsense, because this is installation directory and as such is shared\common to all users, there is no need to make a copy per user.
    All modules, scripts and configuration data in that folder applies system wide and thus to all user profile.

    What are you trying to achieve?

    If your plan is to copy user specific data such as PS profile for current user or user specific modules and scripts then you're looking for C:\Users\USERNAME\Documents\WindowsPowerShell

    However making a copy of this folder as well doesn't make sense because instead you should apply user specific configuration system wide, effect is the same as copying.

    Otherwise if you want to have Windows PowerShell on another computer that does not have PS, then just install a new instance on that computer.
      My Computer

  3. Paul Black's Avatar
    Posts : 12,280
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #3

    Hello @devnull,

    I TOTALLY agree with zebal.

    I can NOT see the reason or logic.
    What EXACTLY are trying to achieve!
      My Computer


  4. Posts : 116
    Win 10 Pro 64-bit
    Thread Starter
       #4

    I've now clarified (see "UPDATE" in my original post above) that I'm speaking about the folder with the Windows shortcuts.
      My Computers

  5. zebal's Avatar
    Posts : 908
    Windows 10 Pro x64 20H2 (Build: 19042.867)
       #5

    I'm sorry but now it's even less clear what you want to do than what was before.
      My Computer


  6. Posts : 116
    Win 10 Pro 64-bit
    Thread Starter
       #6

    zebal said:
    I'm sorry but now it's even less clear what you want to do than what was before.
    Whenever I do a clean install of Windows, I create a folder with many subfolders on my second/storage drive (internal) for all of the data that I create as well as the Windows shortcuts that are initially found in C:\ProgramData\Microsoft\Windows\Start Menu\Programs and C:\Users\username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs. In this particular case---I don't recall exactly how this happened---the Windows PowerShell folder that initially appears in one of the above-refenced folders ended up, at some point while I was moving all of the various shortcuts as just described, on my Desktop. I cannot currently move it to my own folder with all of the rest of the Windows shortcuts, and I want to do that.
      My Computers

  7. Paul Black's Avatar
    Posts : 12,280
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #7

    Hello @devnull,

    Can you not create a Shortcut to the . . .

    C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe

    . . . for example [ or whatever version ]?
      My Computer


  8. Posts : 116
    Win 10 Pro 64-bit
    Thread Starter
       #8

    Paul Black said:
    Hello @devnull,

    Can you not create a Shortcut to the . . .

    C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe

    . . . for example [ or whatever version ]?
    Yes, I could do that, thanks, but I've already created---by copying the original folder, which gave me a folder that I can completely control---a folder with the Windows PowerShell shortcuts that actually launch PowerShell (as opposed to just opening the folder with the executables), and that better serves my purposes.

    I just can't get rid of the orignal shortcuts folder, with its special permissions (as described above), unless I take ownership of it. I've accomplished this in the past, but I don't recall now exactly how I did thatgot rid of this "undeletable" folder. I'm just being a bit more careful before I proceed this time than I have in the past.
    Last edited by devnull; 3 Weeks Ago at 17:29.
      My Computers

  9. zebal's Avatar
    Posts : 908
    Windows 10 Pro x64 20H2 (Build: 19042.867)
       #9

    You don't need to copy anything.

    Simply go to:
    C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell

    Here copy shortcut to your desired location and it should work?
      My Computer

  10. Paul Black's Avatar
    Posts : 12,280
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #10

    Hello @devnull,

    devnull said:
    I just can't get rid of the orignal shortcuts folder, with its special permissions (as described above), unless I take ownership of it. I've accomplished this in the past, but I don't recall now exactly how I did that. I'm just being a bit more careful before I proceed this time than I have in the past.

    Have a look at these . . .

    > How to Change Permissions of File, Folder, Drive, or Registry Key for Users and Groups in Windows 10
    > How to Add Take Ownership to Context Menu in Windows 10

    I hope this helps.
      My Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 10:01.
Find Us




Windows 10 Forums