Client Management Suite

  • 1.  Problem copying file into the AppData folder

    Posted Jul 20, 2017 10:30 AM

    I am trying to copy/replace an .ini file into the following folder.

    C:\Users\%USERNAME%\AppData\Roaming\ImageNow

    I have tried doing this by way of a Package Delivery Task and Managed Software Delivery  in Altiris. Both methods give me a success code, but the file never copies over. Here is what I am running in the .bat file for Managed Software delivery

    echo off
    mkdir "c:\Drivers\ImageNow\ImageNow SMS"
    copy "ImageNow SMS\*.*" "c:\drivers\ImageNow\ImageNow SMS\"
    Copy "c:\drivers\ImageNow\ImageNow SMS\imagenow.ini" "C:\Users\%USERNAME%\AppData\Roaming\ImageNow" 

    The stange thing is if  open a command prompt and run the .bat file I pushed out to the client through Managed Software Delivery it copies the file over. Not sure why the file does not copy over when executed by the Altiris agent.

    For the Package Delivery task  I am using the following for the "Location on destination computer"

    C:\Users\%USERNAME%\AppData\Roaming\ImageNow

    I also tried using %APPDATA%\ImageNow and that also gave me a success code, but did not actually copy the file over. 



  • 2.  RE: Problem copying file into the AppData folder

    Posted Jul 20, 2017 11:19 AM

    the issue I see is that if the job is using the application credentials, the %username% will be the altiris service account.  If you run the task as "current logged on user" the appdata\%username% will be that user that is logged on.  Just keep in mind that if no one is logged on, the task will fail. 



  • 3.  RE: Problem copying file into the AppData folder

    Posted Jul 20, 2017 11:20 AM

    have you tried a copy file task instead of a batch script?



  • 4.  RE: Problem copying file into the AppData folder

    Posted Jul 20, 2017 11:30 AM

    Hmm... yeah see that is what I was thinking also so I tried to change the run options to Current logged-on user. That also did not work. 



  • 5.  RE: Problem copying file into the AppData folder

    Posted Jul 20, 2017 11:33 AM

    I have not. I have never succesfully created a copy file task. I think part of the problem is I do not have domain admin credentials, so I am not sure how I could do a copy file task without that since it asks for me to insert them. Unless I am missing something. I am newer to Altiris and still learning as I go. Any help would greatly be appreciated. 



  • 6.  RE: Problem copying file into the AppData folder

    Trusted Advisor
    Posted Jul 20, 2017 12:23 PM

    Hi Mark,

    The Altiris Agent will be running as the System Account on the machine, so it should have permission to do whatever is required when executing tasks. 

    Have you tried echoing the %USERNAME% token as a test to see which user it is showing first?

    Thanks



  • 7.  RE: Problem copying file into the AppData folder

    Posted Jul 20, 2017 01:13 PM

    Hey Sam,

    If I run echo %USERNAME% while logged onto the machine it pulls up the logged in user. I am guessing that is why I am able to copy the file when I run the batch sctipt.

    Interestingly enough I think I did find where Altiris is placing the file. It creates the following and places the file there:

    C:\Users\MACHINENAME$\AppData\Roaming

    I checked another machine and sure enough it creates a user profile based on the machine name and adds a $ at the end. The only thing under that user profile is an appdata folder. 

    I tried to run the package delivery task as the current logged in user, but that produced an failure code. 

     



  • 8.  RE: Problem copying file into the AppData folder

    Posted Jul 21, 2017 05:36 AM

    I'd create a separate Software Release for the INI file with a command line of:

    CMD /C "xcopy *.* "%userprofile%\Appdata\Roaming" /S /Q /Y /H /I

    Run this in a Managed Software Delivery run in the user's context, probably with a schedule of "At login".

    For it to work your users need Read access to the directory the Symantec Management Agent downloads packages to, usually under C:\program files, if they don't you can specify an "Alternate Download Location" in the Advanced porperties of the Managed Software Delivery Policy.

    I often put a dummy text file in with the INI file for versioning, "imagenowv1.txt".