Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: add reg data through a batch file instead of a .reg file  (Read 11729 times)

0 Members and 1 Guest are viewing this topic.

mioo_sara

    Topic Starter


    Intermediate

    add reg data through a batch file instead of a .reg file
    « on: June 05, 2009, 12:49:29 AM »
    hi there to  all  my friends specially  you !
    well.  i have a reg key (myreg.reg) when  i double click  it..  it exports some data to  registry  and it's just fine
    now here's the problem= i want to  add these data through a batch  file(not myreg.reg file) so i think  i should use REG ADD right?
    here is my  reg data

    Quote
    REGEDIT4

    [HKEY_CURRENT_USER\Software\My Own File Sorter]

    [HKEY_CURRENT_USER\Software\My Own File Sorter\Regcode]
    @="DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"

    [HKEY_CURRENT_USER\Software\My Own File Sorter\User]
    @="new user"

    i copid these data into  a new batch  file and replaced [ ] with " "  then  i added  REG ADD at the beginning of each  line so it looks like this

    Quote
    REG ADD "HKEY_CURRENT....
    REG ADD "HKEY_CURRENT....
    it adds each  line successfully into the registry but it's not  working what's wrong?  can  you  fix it for me?
    « Last Edit: June 05, 2009, 01:48:34 AM by mioo_sara »

    Archer



      Beginner

      Thanked: 11
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 7
    Re: add reg data through a batch file instead of a .reg file
    « Reply #1 on: June 05, 2009, 12:54:31 AM »
         Hello, mioo_sara.
    You should use 'Reg Add', not 'Add reg' ;)
    For additional help go here.
    良し! いこう! いこぜ みんな!

    mioo_sara

      Topic Starter


      Intermediate

      Re: add reg data through a batch file instead of a .reg file
      « Reply #2 on: June 05, 2009, 01:49:18 AM »
      sorry  i mistyped it !! i changed it to REG ADD and it still  is not working !! why?
      i believe  problem  is in  lines (3 and 5)
      by the way  i updated my  first post
      thanks dear archer
      i am wating can  someone solve the problem?

      Reno



        Hopeful
      • Thanked: 32
        Re: add reg data through a batch file instead of a .reg file
        « Reply #3 on: June 05, 2009, 03:10:28 AM »
        reg add "HKCU\Software\My Own File Sorter" /v Regcode /d "DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"

        Prince_



          Beginner

          Thanked: 5
          Re: add reg data through a batch file instead of a .reg file
          « Reply #4 on: June 05, 2009, 03:26:56 AM »
          Code: [Select]
          REGEDIT4
          ;@start regedit /s "%~f0"&goto :eof
          [HKEY_CURRENT_USER\Software\My Own File Sorter]

          [HKEY_CURRENT_USER\Software\My Own File Sorter\Regcode]
          @="DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"

          [HKEY_CURRENT_USER\Software\My Own File Sorter\User]
          @="new user"

          mioo_sara

            Topic Starter


            Intermediate

            Re: add reg data through a batch file instead of a .reg file
            « Reply #5 on: June 05, 2009, 05:06:43 AM »
            thank you  both  (Prince_ and Reno)
            well  Prince_ solved the problem  thank you  very  much
            but RENO  although  my  problem  is solved but just for learning purpose  i ask this question=
             in your codes all values are exported into registry  and i don't see any error but it's not working(with your code not Prince_)
            i changed "Regcode" line  as you posted and "User" line  as you see below

            Quote
            reg add "HKCU\Software\My Own File Sorter"

            reg add "HKCU\Software\My Own File Sorter" /v Regcode /d "DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"

            reg add "HKCU\Software\My Own File Sorter" /v User /d "new user"

            but although it hasn't  error  but it's not working what's the correct algorithm?
            well  as i mentioned problem  is solved with ( Prince_ ) codes and it's just for educational  purpose so if you don't have time ignore it

            worrywart2009



              Newbie

              Re: add reg data through a batch file instead of a .reg file
              « Reply #6 on: August 31, 2009, 02:45:37 AM »
              i have had trouble with  an error that comes up , it says error when write data to registry. how does one correct that ?

              mroilfield



                Mentor
              • Thanked: 42
                • Yes
                • Yes
              • Computer: Specs
              • Experience: Experienced
              • OS: Windows 11
              Re: add reg data through a batch file instead of a .reg file
              « Reply #7 on: August 31, 2009, 02:50:02 AM »
              i have had trouble with  an error that comes up , it says error when write data to registry. how does one correct that ?

              Worrywart2009,

              You need to start your own thread.
              You can't fix Stupid!!!