13 Replies Latest reply on Jul 20, 2011 9:57 AM by Catalysttgj

    setting registry keys...


      hi everyone


      i want to deploy a .bat to set some registry keys on my clients.

      i got a .reg file with the keys and values and call that file from my .bat


      REM here is the Bat

      @echo off

      regedit.exe /s test.reg



      and here the .reg


      Windows Registry Editor Version 5.00


      "Package deployed"="yes"



      after setting the keys i want to read them out via the ldappl3.template-file and put them into my database to do some querries.


      when i run the bat on my core-server it works fine...the keys are set in the regestry.

      when i deploy the .bat-package with .reg as additional file, nothin happens.

      would it help if i wrap the .bat- and the .reg-file to one .exe-file? how can i do that?


      are there other (easier) ways to set some registry keys with landesk 9? If so-->how are they workin?



      i hope somebody can help me out



        • 1. Re: setting registry keys...
          mercuzio Apprentice

          Hi, i usually use LANDesk Package Builder utility to work on registry keys, it's very easy  and it generates exe you can threat as SWD packages in console. Anyway it sounds strange your package does not work. Can you check if .BAT and .REG are in the LANDesk\LDclient\ LDMScache folder on client and try to run the batch from there. remember that LANDesk run packages as local system account but when you launch manually you run it as logged user.


          Attach Package Builder english;  after install go to Start Program LANDesk Management | Enhanced package Builder and to System Change | registry   category try it

          • 2. Re: setting registry keys...

            thx for the fast reply....


            ill try the packagebuilder and post if its workin...


            when i run the .bat on the client manually it works...

            so what goes wrong is running the bat as local system...


            are there known mehtods to make a .bat "windows-local-system-safe"

            do i have to add a special command at the end of my batch?

            or must ensure that errorlevel=0 at the end?

            • 3. Re: setting registry keys...

              until now...its not working with the packagebuilder...




              what is the difference between running cmd.exe as logged user and runnit it as local system?

              is the logged user allowed to use commands the local system is not allowed to?

              • 4. Re: setting registry keys...
                MarXtar ITSMMVPGroup

                There is a difference in permissions. Anything trying to go to the current user key will not work under localsystem when it would when launched as a user and also access to the network is unlikely to work.


                Odd that you say this doesn't work in package builder either. We can either troubleshoot your batch process or we can troubleshoot the package builder script you have created.


                Looking at the batch file issue, you were asked if both files were in the cache directory. If they are, perhaps add a '> log.txt' option at the end of your launch commandline so that you get something saying what the output of the batch file was. this could help you understand if any errors are happening.

                • 5. Re: setting registry keys...
                  mercuzio Apprentice

                  Package Builder string for adding a new Reg Key should look like this:


                  KEY: new, "HKEY_LOCAL_MACHINE\SOFTWARE\LANDesk\test"
                  VALUE: reg_sz, new, "test", "ok"



                  Then you build your EXE an deploy it as SWD, what task result you have? could you attach your bulder .CFG o screenshot the script?


                  (My Builder is an italian version)



                  1 of 1 people found this helpful
                  • 6. Re: setting registry keys...
                    LANDeskWizrd SSMMVPGroup

                    I think a simpler approach to set registry keys using LANDesk is to create a Custom Definition. If you have your Security scan occurring daily then why not let LANDesk find and create registry keys for you. While Package Builder should work, I prefer the Custom Definition method as it gives you more control. All you need to do is create a new Custom Definition and choose a Detection Logic and then give it Patch Install Commands.

                    • 7. Re: setting registry keys...

                      ahhh after reading the intro text...i created my first exe!

                      and on the core the exe works and the keys are added correctly


                      was not able to deploy the exe cuz my vm-workstation makes some problems^^


                      ill post it here if that was workin or not!

                      • 8. Re: setting registry keys...



                        yes now its working! ty for the package builder!


                        can i do the same with the admin studio limited editon?



                        • 9. Re: setting registry keys...
                          egarlepp Employee

                          Yes Admin Studio Limited will allow you to do the same, but it will be an MSI and not an EXE... Which is ultimately better in the long run.  It is more complicated to use than the package builder, but with a few hours of play you could figure it out.

                          • 10. Re: setting registry keys...

                            I use manage scripts to change registry keys on one system (computer) or 800 systems 

                            • 11. Re: setting registry keys...

                              I have been trying to use admin studio without luck. Do you install admin studio on the server, or on a computer?


                              Need some help, thanks.

                              • 12. Re: setting registry keys...
                                egarlepp Employee

                                You should install it off of your core server and on a computer.  You should also have a vm to create baselines and installs.

                                • 13. Re: setting registry keys...
                                  Catalysttgj Expert

                                  +1 on this. I prefer custom definition method, since it provides a "detected" or "Patched" result. Then there's not as much need to get into the inventory side of the house.