Deployment and Imaging Group

 View Only
Expand all | Collapse all

How to execute or change registry value

Migration User

Migration UserAug 11, 2015 07:10 AM

  • 1.  How to execute or change registry value

    Posted Aug 10, 2015 10:35 AM

    Hi

    We have to change logonbackground using Client managament solution 7.6. We want to paste our logonbackground into specific path and after that we need one registry value to be change.

    OR

    we want to copy registry into C:\Windows\System32\oobe\info\backgrounds path and want to execute

    How i can achieve this??



  • 2.  RE: How to execute or change registry value

    Posted Aug 10, 2015 10:53 AM

    Hi, you may want to take a look at these references.

    https://technet.microsoft.com/en-us/library/cc732643.aspx

    https://technet.microsoft.com/en-us/library/cc742162.aspx

    Using that native Windows tool should help you achieve what you're after.

    -BBC



  • 3.  RE: How to execute or change registry value

    Posted Aug 10, 2015 11:01 AM

    Hi BBC

    There is other option i have that i can save that registry into path which i want but how to execute that on client system is there any command syntax to execute because i am using Copy to feature of Client Management solution



  • 4.  RE: How to execute or change registry value

    Posted Aug 10, 2015 11:03 AM

    Hi,

    1. Put the reg file (which will change the picture) and screenshot in some specific folder on NS.
    2. Import this folder as a Software package and create CMD which will execute the reg file.
    3. *If you will delivery this by Managed Delivery Policy you should create Detection rule, which will find out, that your image is set as desktop background (ex. Standard Rule->Registry Key Value)
    4. Create Managed Delivery Policy or Quick Delivery task.
    5. Specify non default location in Advanced -> Download Options tab.
    6. Execute the task or the policy on clients.

    NB:Software Management Solution plug-in should be installed on computers.

     

    Regards,
    Dmitri

     

     



  • 5.  RE: How to execute or change registry value

    Posted Aug 10, 2015 11:06 AM

    More details about how to use Managed Delivery Policy or Quick Delivery Task you may found in this Best Practice Document: http://www.symantec.com/docs/GUIDES10019



  • 6.  RE: How to execute or change registry value

    Posted Aug 10, 2015 03:19 PM

    I agree with Dmitri, creating a location to hold the fileson the ns then you can creat a script task to copy the fila and then run a "reg" add to up date a registry key to point it to new bg. After the task or package is created, you can create a managed software policy to enforce on all devices



  • 7.  RE: How to execute or change registry value

    Posted Aug 10, 2015 05:03 PM

    You could also turn the .reg file into an EXE by using this:

    http://sourceforge.net/projects/reg2exe/

    Then you can import it as actual software into the Software Library in the console. Just another option...



  • 8.  RE: How to execute or change registry value

    Posted Aug 11, 2015 06:58 AM

    Hello Dmitri

    I am have import folder as a software package, next i am confuse...

    bcoz i know about settings of exe and msi files. i am stuck on below

     180px_registry_1.JPG

     



  • 9.  RE: How to execute or change registry value

    Posted Aug 11, 2015 07:10 AM

    Please use next Parameters:

    commandline.png



  • 10.  RE: How to execute or change registry value

    Posted Aug 11, 2015 08:22 AM

    Hello Dmitri

    I have done the same but unfortunately its failed.

     



  • 11.  RE: How to execute or change registry value

    Posted Aug 11, 2015 08:36 AM

    Hello vikas1101,

     

    Do you use static path in bat file or you use "%~dp0\file.reg" to execute reg file from current directory?

     

    Regards,
    Dmitri



  • 12.  RE: How to execute or change registry value

    Posted Aug 11, 2015 09:10 AM

    Hello Dmitri

    First of all i want to copy this in C:\Windows\System32\oobe\info\backgrounds 

    My reg file having mention below path

     

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background]
    "OEMBackground"=dword:00000001



  • 13.  RE: How to execute or change registry value

    Posted Aug 11, 2015 10:34 AM

    Hello vikas1101

    try this inside of the bat file:

    IF NOT EXIST C:\Windows\System32\oobe\info\backgrounds mkdir C:\Windows\System32\oobe\info\backgrounds
    xcopy /s /y /f /o "%~dp0image.png" C:\Windows\System32\oobe\info\backgrounds
    regedit.exe /s "%~dp0regfile.reg"

     

    put all files in one directory like that:

    package_folder.png

    import into one software resource like that:

    package_0.png

    Create new Quick Delivery Task, and run it on client.

    Regards,
    Dmitri



  • 14.  RE: How to execute or change registry value

    Posted Aug 12, 2015 06:57 AM

    Hello Dmitri

    I have tried above solution but still no luck.

    Is there any script that can run registry.

    One question... you have mention regedit.exe ???



  • 15.  RE: How to execute or change registry value

    Broadcom Employee
    Posted Aug 12, 2015 07:11 AM

    Hi,

    If we talk about changing registry value then the easiest way is to use the script file with command line. Below is an example of changing registry value for the SMA log: it sets or updates dword value MaxSize with 2000.

    reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Altiris Agent\Event Logging\LogFile" /t REG_DWORD /v MaxSize /d 2000 /f

    You might need to specify administratior account in advanced script task properties depending on you client's configuration. 

    Run command "reg /?" for the help on registry operations.

    HTH,

    Alex.



  • 16.  RE: How to execute or change registry value

    Posted Aug 12, 2015 07:48 AM

    There are several options but the one I use most is "regedit.exe /s path of .reg file"

    You can also use "reg add" and then the registry key you would like to add. If you go to a DOS prompt and type in either "reg /?" it will give you examples of how to use these commands. The thing to remember that most command line options for a silent install/add you add the "/s" after the command but when using regedit.exe to add a registry entry silently you have to put the "/s" right after the regedit.exe as seen above.



  • 17.  RE: How to execute or change registry value
    Best Answer

    Posted Aug 12, 2015 07:59 AM

    It sounds as if there is a bit of confusion on what you want to achieve because all of the above suggestions should lead you to the goal you mentioned?

    To add your registry entry, you may want to do as Alex or Dimitri suggested. For simplicity reasons, I suggest you use a reference machine to create and then export the settings from the registry into a .REG file.

    Once done, you can copy the <Whateverfilename>.REG to the client and import it using the command line syntax Dimitri mentioned (regedit.exe /s "%~dp0regfile.reg" where %~dp0 refers to the current working directory and regfile.reg to the previously exportred registry file).

    If you're firm with using the REG command, youcan also create any registry keys and the value itself using an embedded script. Example below.

    Assuming that the last level for the registry value you'd like to add doesn't exist, the commands would look like this:

    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background"

    REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background" /v "OEMBackground" /t REG_DWORD /d 1 /f

    /v specifies the registry value you want to add

    /t specifies the type of data it will contain

    /d is the data being set against the value you add or change

    /f enforces the information to be written