Ghost Solution Suite

 View Only
  • 1.  Environment Variables

    Posted Jul 09, 2007 09:01 AM
    Our campus tracking system uses an environment variable to keep track of computers.  I need this specific environment variable to be saved when an image is deployed.  Is there a way to specify an environment variable you don't want destroyed?

    Ben


  • 2.  RE: Environment Variables

    Posted Jul 09, 2007 10:42 AM
    As the environment variables are in the registry I can only think of two ways to do this.  Perhaps in a login script, or using autoexnt.bat you can just echo the var to a text file, or a reg export of the env. variables in a specific folder on the computer and then use the preservation features of ghost to preserve that folder or file.
     
    The reg key for the machine is:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
     
    Secondly, if you use local accounts,  you can assign the environment variable as a user specific one and then preserve the users profile on the machine.
     
    Either way the var would be preserved and in some form of after script could then be re-applied to the machine.


  • 3.  RE: Environment Variables

    Posted Jul 09, 2007 03:40 PM
    I have gotten to a point where I can now type one command using reg add .......   However, to work the best it would be nice to tell ghost to execute a command to add the variable.  The variables data would consist of a number.  We name our computers ws????.  How can I manipulate strings using the windows command line so I can use %COMPUTERNAME% and cut off the ws?  I can not change the computers name of ws???? to ???? because of the networking people's domain set up.

    I am not doing the reg export and reg import as suggested earlier because after using reg import I am told the operation completed successfully when really it did not.  It is also more desirable to tell gss to execute commands than it would be to have gss execute commands and preserve a .reg file while deploying.

    Thanks,
    Ben


  • 4.  RE: Environment Variables

    Posted Jul 09, 2007 05:00 PM
    Ben,
     
    If the environment variable you are trying to preserve is your Computers name then I am afraid that is far more complicated than just re-setting an environment variable back.  Fortunately symantec provides a way in GSS.  The simplest way to do that is to use a template and use the configuration information already gathered from your machines to reset it back to its original computer name.


  • 5.  RE: Environment Variables

    Posted Jul 18, 2007 12:28 PM
    I found a solution.  I was already using ghost configuration preservation settings when I cloned a machine.  My problem was our campas tracking system needed only the number in an environment variable (the xxxx out of WSxxxx).  Executing the command

    reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v [env variable name] /d %COMPUTERNAME:~2%

    would place a new variable correctly named without the ws in the front.  Because ghost already configured the name correctly this command works very nicely.  The only tricky thing to remember was to delete the key before we captured the image to begin with.  Thanks for all of your help.