Client Management Suite

 View Only
  • 1.  Batch files and registry keys

    Posted Apr 17, 2012 03:40 PM

    Is there a way that I can use a task to accomplish the changes that I used to use a batch file for?  Example, I want to copy files from the NS server to the client computer.  I used to have a batch file that would call copy "%dp0\myfiles\*.*" c:\clientfiles and then used the batch file as a package in Altiris 6.  What I want to do is just use the copy "%dp0\myfiles\*.*" c:\clientfiles and put it into a command script task but it doesn't seem to be working.  I also want to import a registry key with this same task.  I've tried using the run script task but that doesn't appear to work either.  Any ideas?



  • 2.  RE: Batch files and registry keys

    Posted Apr 18, 2012 06:02 AM

    There is a copy file/folder task. You could use that for copying files/folders over. In saying that I've had problems with it when put in a policy. It would be great (if it worked as meant)

    For the registry one I just use a VBscripts.

    you could put these 2 tasks in a job.

    thats the theory - good luck in getting it working.

     

     

     



  • 3.  RE: Batch files and registry keys

    Posted Apr 18, 2012 08:52 AM

    You have to consider what context the Altiris process is running in, and on what operating system you are running it.

    Since the Altiris client is typically running using the LocalSystem account, any process spawned using this account will not have access to any network resources as the LocalSystem account does not have network rights.  Therefore any copy task which needs to copy files from a network location to the local hard disk needs to be run using a domain account.

    When it comes to importing registry keys, you need to specify whether the keys are intended for the HKLM hive or the HKCU hive.  If HKCU, bear in mind that this will not be the user account that may be logged in, but it will be the service account that is updated. So for HKCU settings you need to identify the SID(s) of any user(s) logged in and target HKU\<sid> instead.  If you use roaming profiles then you need to use something like active setup instead, as the user profile may not exist locally if the user is not logged in.



  • 4.  RE: Batch files and registry keys

    Posted Apr 18, 2012 11:50 AM

    I would make this a software resource.  Include the files you want to copy as the package files, and include a .bat or .vbs file to handle the registry changes.  Set an alternate package download location of C:\clientfiles\ and the files will be copied there as part of executing your .bat/.vbs registry change.  This is therefore a single task (Quick Delivery task) or policy (Managed Software Delivery) and can be enforced using a detection rule (checking for files and/or registry value).



  • 5.  RE: Batch files and registry keys

    Posted Apr 19, 2012 11:10 AM

    We made a similar switch. Under DS 6.9 we would copy a .REG file down to c:\local and then run REGEDIT /S on it from there.

    Under 7.1, I just use REG ADD directly in the command script task. That way I can keep everything compact in one task without having to go to VBScript.

    Remember to turn on the option "Save script output with task status" which is under the Advanced button. That will make troubleshooting of your scripts much easier.