CA Client Automation

 View Only
  • 1.  How to put a file in the %appdata% folder for the current user?

    Posted Mar 12, 2015 05:36 PM

    I need to replece a file for the logged on user in the %appdata% folder.

    This script works locally:

    copy /Y \\server\share\data.ini %appdata%\application\Common\data.ini

    but when running the script from Client Automation... the %appdata% variable is pointing to C:\windows\system32\.... and not to c:\users\<currentuser>\appdata.....

     

    What must I do???

     

    thanks a lot,

    Harold



  • 2.  Re: How to put a file in the %appdata% folder for the current user?
    Best Answer

    Posted Mar 12, 2015 05:43 PM

    Run the job against the USER, not the computer.

     

    If created as an Asset Job, instead of scheduling the asset job against a group of computers, you can schedule it against a group of users.

     

    If created as a software delivery job, you would have to enable ‘user Profiles’ in configuration policy. This will create new UNITS in the User Profiles branch of the tree, one new unit for each Computer/User combination. You can submit the job to these user profiles as needed.

     

    In either case, the job will run in the context of the user not the machine so %appdata% will resolve properly. Be aware though that enabling User Profiles for SD does add both processing AND database overhead as it creates a new Unit for each user on each machine.

     

    As an alternative, you could write a script to navigate through ALL the user profiles and place the file in all %appdata% folders found.

     

    Steve McCormick, ITIL

    CA Technologies

    Principal Services Consultant

    Tel: +1-731-676-4223

    Stephen.McCormick@ca.com

    <mailto:Stephen.McCormick@ca.com>



  • 3.  Re: How to put a file in the %appdata% folder for the current user?

    Posted Mar 16, 2015 12:20 PM

    Hello Stephen,

    Now the script is working as expected.  I taked the scripting route by sweeping the users directory.

    thanks a lot,

    Harold