none
How can I install and enable a themepack for another user in Windows 7?

    Domanda

  • I'd like to write a powwershell script to set a Theme (.themepack-File) for all the users on my system. I already did this successfully in Windows XP, but cannot make it run in Windows 7. The problem is that the Theme is later available for the other user, but not activated. When I try to set the theme for a user that is currently logged on, it works flawlessly of course. Here is what I do in my scrupt, the $cred variable already contains the user credentials required. I run this script as an addministrator user from another user account.

        $args = "/K "
        $args += "`"$env:MYTESTPATH\themes\Touch-Win7.themepack`""

        $cred = Get-CredentialMachineUser
        $proc = start-process -PassThru -LoadUserProfile -cred $Cred -ArgumentList $args $env:SystemRoot\System32\cmd.exe

    When I run this script, I get a messagebox, probably from the Windwos 7 Thememanager containing the following error message:

    **[Window Title]
    ::{26EE0668-A00A-44D7-9371-BEB064C98683}\1\::{ED834ED6-4B5A-4BFE-8F11-A626DCB6A921},?Theme=C%3A%5CUsers%5Cmachine%5CAppData%5CLocal%5CMicrosoft%5CWindows%5CThemes%.theme
    [Content]
    Windows cannot access the specified device, path, or file.  You may not have the appropriate permissions to access the item.
    [OK]**

    Do you have any idea what's going wrong, and how I can enable a themepack successfully for another user?
    • Modificato Erik78 martedì 20 marzo 2012 08:29
    martedì 20 marzo 2012 08:28

Risposte

Tutte le risposte

  • Have you tries using the "runas" option for an elivated cmd: http://technet.microsoft.com/en-us/library/bb490994.aspx

    J W Stuart: http://www.pagestart.com


    Never be afraid to ask. This forum has some of the best people in the world available to help.

    martedì 20 marzo 2012 14:19
  • Have you tries using the "runas" option for an elivated cmd: http://technet.microsoft.com/en-us/library/bb490994.aspx

    J W Stuart: http://www.pagestart.com


    Never be afraid to ask. This forum has some of the best people in the world available to help.

    If I use runas, I assume I would install the theme for the elevated user, wouldn't I? Because I want to install the themepack for a restricted user as well, without that user being logged on at the time of installation.

    Next, runas is a bad idea, because I need this script to run without any user interaction, and for some really strange security concerns - why not leave that decission to the user using it? - runas cannot be passed a password, so it is totally useless in scripting :(

    I have also looked for the GUID ED834ED6-4B5A-4BFE-8F11-A626DCB6A921 from the error message I get, and this seems to be the control panel of the Theme manager (.cpl). So it looks to me that Windows cannot access the CPL for that user properly. Is there another way to apply a theme for another user?

    I.e, set it in the registry by using a script? But I don't have enough basic understanding of what internally happens when I doubleclick a .themepack file :(


    • Modificato Erik78 mercoledì 21 marzo 2012 08:34
    mercoledì 21 marzo 2012 04:57
  •  

    Hi,

    Also I suggest to contact Script Forum to check if your script has problem:

    The Official Scripting Guys Forum! Forum

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.  Thank you for your understanding.

    Regards,

    Leo   Huang


    Leo Huang

    TechNet Community Support

    giovedì 22 marzo 2012 03:33