Jump to content











Photo
- - - - -

RegImport command


  • Please log in to reply
39 replies to this topic

#1 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 19 June 2007 - 09:23 AM

Hi

i don't know if this true or not ..
but i think regimport command merging the registry file into the local system registry

#2 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 19 June 2007 - 11:28 AM

Thanks for reporting, can you post a snippet of your produced reg file?

Thanks! :1st:


Just a sugestion, but why not uploading to youtube and then add a direct preview here?

#3 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 19 June 2007 - 11:46 AM

Hi

here's a script to show the problem

first make sure that there's no such key in you registry
HKEY_CURRENT_USER\New Key #1

then run the script

now check your registry and look at HKEY_CURRENT_USER

* the registry file encoded inside script file


about youtube .. i'm too lazy to do that :1st:

#4 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 19 June 2007 - 11:51 AM

maybe because i didn't use
RegHiveLoad,RegHiveUnload command's ?

#5 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 19 June 2007 - 12:12 PM

maybe because i didn't use
RegHiveLoad,RegHiveUnload command's ?


I did not unpack the encoded .reg, but I think you gave yourself the answer

Peter :1st:

#6 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 19 June 2007 - 12:29 PM

I did not unpack the encoded .reg, but I think you gave yourself the answer

Peter :1st:

Thanks

#7 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 20 June 2007 - 06:19 PM

For safty purpose maybe wb should deniy access to RegImport and RegWrite unless the RegLoadHive is used first

someone please post a code snippet on how to use RegImport function ..

is this the right way to use it ?
Echo,Merging registry file...

Run,%ScriptFile%,RegHiveLoadALL

RegImport,"%ScriptDir%\Tese.reg"

Run,%ScriptFile%,RegHiveUnLoadALL



[RegHiveLoadALL]

Echo,Loading registry hive's...

RegHiveLoad,"H7Default","%TargetDir%\I386\system32\config\default"

RegHiveLoad,"H7Software","%TargetDir%\I386\system32\config\software"

RegHiveLoad,"H7System","%TargetDir%\I386\system32\config\system"

RegHiveLoad,"H7Sam","%TargetDir%\I386\system32\config\sam"

RegHiveLoad,"H7Security","%TargetDir%\I386\system32\config\security"



[RegHiveUnLoadALL]

Echo,UnLoading registry hive's...

RegHiveUnload,"H7Security"

RegHiveUnload,"H7Sam"

RegHiveUnload,"H7System"

RegHiveUnload,"H7Software"

RegHiveUnload,"H7Default"


#8 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 20 June 2007 - 07:05 PM

The command you refer works anywhere in the registry, limiting to only work when hives are loaded is not very recommended since we would lose flexibility to apply changes on the host if ever required one day (mobileOS is a good example for an overall registry tweaking using wb)..

:1st:

#9 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 20 June 2007 - 07:27 PM

The command you refer works anywhere in the registry, limiting to only work when hives are loaded is not very recommended since we would lose flexibility to apply changes on the host if ever required one day (mobileOS is a good example for an overall registry tweaking using wb)..

Sorry .. i didn't know that :1st:

..

the previous snippet will it merge the registry file in the target hive's .. is it correct coding?

#10 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 20 June 2007 - 09:42 PM

Looks good enough - I'm only a bit worried about Vista UAC which disables the option to load hives for safety reasons, but for the meanwhile your solution looks very good.

:1st:

#11 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 07:04 AM

For safty purpose maybe wb should deniy access to RegImport and RegWrite unless the RegLoadHive is used first

someone please post a code snippet on how to use RegImport function ..

is this the right way to use it ?

Echo,Merging registry file...

   Run,%ScriptFile%,RegHiveLoadALL

   RegImport,"%ScriptDir%\Tese.reg"

   Run,%ScriptFile%,RegHiveUnLoadALL

   

   [RegHiveLoadALL]

   Echo,Loading registry hive's...

   RegHiveLoad,"H7Default","%TargetDir%\I386\system32\config\default"

   RegHiveLoad,"H7Software","%TargetDir%\I386\system32\config\software"

   RegHiveLoad,"H7System","%TargetDir%\I386\system32\config\system"

   RegHiveLoad,"H7Sam","%TargetDir%\I386\system32\config\sam"

   RegHiveLoad,"H7Security","%TargetDir%\I386\system32\config\security"

   

   [RegHiveUnLoadALL]

   Echo,UnLoading registry hive's...

   RegHiveUnload,"H7Security"

   RegHiveUnload,"H7Sam"

   RegHiveUnload,"H7System"

   RegHiveUnload,"H7Software"

   RegHiveUnload,"H7Default"


Your test .reg really writes into the local registry:

[HKEY_CURRENT_USER\New Key #1]
"New Value #1"=""
"New Value #2"=hex:


It should be:

[HKLM\H7System\New Key #1]
"New Value #1"=""
"New Value #2"=hex:

or similar, in order to write into your hive.

BTW: I usually open only one hive and close if it is not more used.
Then the next hive ...
Sam and Security until to today are never used ...

Peter

#12 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 21 June 2007 - 12:58 PM

Thanks that's what i'm looking for

BTW: I usually open only one hive and close if it is not more used.
Then the next hive ...
Sam and Security until to today are never used ...

Peter


yes it's better but in order to use this style i'll have to make multi registry file's .. one for each hive

#13 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 01:08 PM

yes it's better but in order to use this style i'll have to make multi registry file's .. one for each hive

And that could be done like:
RegHiveLoad,"H7Default","%TargetDir%\I386\system32\config\default"

RegImport,"%ScriptDir%\H7Default.reg"

RegHiveUnLoad,"H7Default"

RegHiveLoad,"H7Software","%TargetDir%\I386\system32\config\software"

RegImport,"%ScriptDir%\H7Software.reg"

RegHiveUnLoad,"H7Software"

RegHiveLoad,"H7System","%TargetDir%\I386\system32\config\system"

RegImport,"%ScriptDir%\H7System.reg"

RegHiveUnLoad,"H7System"

RegHiveLoad,"H7Setup","%TargetDir%\I386\system32\setupreg.hiv"

RegImport,"%ScriptDir%\H7Setup.reg"

RegHiveUnLoad,"H7Setup"

And inside the H7???.reg there is
[HKLM\H7???\MyKey\MySubKey ...

Peter

#14 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 21 June 2007 - 03:13 PM

program updated but i get error message

#15 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 03:18 PM

program updated but i get error message

Please post the script and the *.reg file!

Peter

#16 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 21 June 2007 - 03:33 PM

Here's the script with generated registry file's encoded inside it plus the file's exported from regedit

#17 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 03:42 PM

Here's the script with generated registry file's encoded inside it plus the file's exported from regedit


You see me a little bit confused!

Why do you want to write into local registry?
Do you want to change some properties of your local FTP program?

Maybe you should explain what the script / *.reg-s are intended to do.

Peter

#18 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 21 June 2007 - 03:58 PM

First the U.reg and M.reg isn't part of the script .. i just included so you can compare the incuded registry file's and the original one if you want to do that..

second the registry file's is just for test purpose i just export it randomly from the regedit

#19 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 04:14 PM

First the U.reg and M.reg isn't part of the script .. i just included so you can compare the incuded registry file's and the original one if you want to do that..

second the registry file's is just for test purpose i just export it randomly from the regedit


Change
[HKLM\H7Software\HKEY_LOCAL_MACHINE\SOFTWARE\Ipswitch\WS_FTP]
To
[HKLM\H7Software\SOFTWARE\Ipswitch\WS_FTP]
(and everything else accordingly)
and try again.

BTW: How works 3 times [Process]?

Peter

#20 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 21 June 2007 - 04:30 PM

Change

[HKLM\H7Software\HKEY_LOCAL_MACHINE\SOFTWARE\Ipswitch\WS_FTP]
To
[HKLM\H7Software\SOFTWARE\Ipswitch\WS_FTP]
(and everything else accordingly)
and try again.

:thumbup: sorry for that .. Thanks :1st:


BTW: How works 3 times [Process]?

i thought it's allowed to use Multiple section name's ?

#21 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 04:33 PM

i thought it's allowed to use Multiple section name's ?

I do not know.
@Nuno?

Peter

#22 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 04:34 PM

:thumbup: sorry for that .. Thanks :1st:

Does it mean that it is ok now?

Peter

#23 h7se

h7se

    Frequent Member

  • Developer
  • 264 posts
  •  
    Palestine

Posted 21 June 2007 - 04:39 PM

No ..

it mean's thank you for warning me about this bug

Change

[HKLM\H7Software\HKEY_LOCAL_MACHINE\SOFTWARE\Ipswitch\WS_FTP]
To
[HKLM\H7Software\SOFTWARE\Ipswitch\WS_FTP]
(and everything else accordingly)
and try again.


i fixed it and then tried again but same error message ..

#24 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 21 June 2007 - 04:47 PM

No ..

it mean's thank you for warning me about this bug


i fixed it and then tried again but same error message ..


Then please post the actual script and the long.

To make future requests of mine unnecessary:

As long as the issue is not solved:
On every new report please add script and log.

Peter

#25 Nuno Brito

Nuno Brito

    Platinum Member

  • .script developer
  • 10547 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 21 June 2007 - 05:03 PM

Please avoid using multiple sections with the same name inside a script.

This is somewhat supported to some extent on older wb versions, but I'm removing to optimize overall speed and avoid scanning the whole script to the end of file.

:1st:




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users