How to write in a user profile, add/edit a registry key in HKCU or use user variables?

Version 3
    Share This:

    This document contains official content from the BMC Software Knowledge Base. It is automatically updated when the knowledge article is modified.


    PRODUCT:

    BMC Client Management


    COMPONENT:

    Client Management


    APPLIES TO:

    BCM >= 11.0



    QUESTION:

    How to write in a user profile?
    How can I add a shorcut to the user desktop?

    How to add/edit a registry key in HKEY CURRENT USER?

    How to use Windows user variables in BCM?


    ANSWER:

     

    The agent runs using the "System" account, therefore it won't be able to write in the connected user's registry keys (e.g. HKCU) or in "C:\Documents and settings", "C:\Users" and you won't be able to use the user's variables (e.g. %USERPROFILE%). If you need the software to add stuff there, you'll have to execute the program as the connected user. In order to set this you have two options:

      

     

      

    A- Set the option "Run As Current User" in an assignment schedule:
    - assign the device (group) then click on "No" when it'll ask if you want to use the default schedule
    - edit the assignment schedule to select "Run as current user":

      

    run_as_current.png

      

    - Click on ok, then right click on the Device (group) assignment and click on "Activate Operational Rule"

      

    run_as_current2.png

      

    The operational rule or the the package will then be assigned to your device (group).

       

    B- Publish the package to a device or to the user and have the user install it himself:
    You'll find more information in the documentation or in the section 6B of the KA 000121358 if you do not know how to publish a package to a user or a device.

      

     

      

    Note:
    - User variables and system variables like %USERPROFILE% must be written like this in steps and packages: ${USERPROFILE} , do not use "%" or it won't work.
    - Attention, there's a prerequisite at the moment: the user will need to have the right to write in the folder ../client/data/CustomInventory or it won't work. Please consider voting for this idea if want this to be improved.

     


    Article Number:

    000121361


    Article Type:

    FAQ/Procedural



      Looking for additional information?    Search BMC Support  or  Browse Knowledge Articles