Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: registry dump to file output differs from DOS cli and system ?

by Discipulus (Canon)
on Mar 05, 2015 at 08:38 UTC ( [id://1118854]=note: print w/replies, xml ) Need Help??


in reply to registry dump to file output differs from DOS cli and system ?

not seems Perl related: a hint from my experience: when you doubt about a Perl bug you wrong or became a master..
Anyway /y is not a recognized switch, see regedit, the correct sysntax seems to be:
REGEDIT /E pathname regedit /E y:\reg_cmd2.reg "/"
I tryed and the first time i had the registry dumped, then i deleted the file and i was no more able to dump a second time... seems a very bad feature coming from the ancient past: now only usable to launch the GUI

Try instead reg as in reg  EXPORT HKU c:\file.reg
HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: registry dump to file output differs from DOS cli and system ?
by gepebril69 (Scribe) on Mar 05, 2015 at 13:18 UTC

    Hi L*

    Thanks for your reply. I based this /y option on info found on this webpage: https://technet.microsoft.com/en-us/library/cc742017.aspx

    Unfortunately removing /y option gave the same result.

    The reg command seems interesting. Unfortunately, it seems you can only export one key at the time, the sum of all 5 keys was 80Mb more that a regular registry dump

    further on it seems that regedit /e only dumps two keys: HKEY_LOCAL_MACHINE and HKEY_USERS, not the other base keys. This is as CLI and in Perl. Will try to run a diff to see what is missing in Perl -> system......

    Is it possible to see what call Perl sends to Windows to figure out why there are two different results....

      The link you provided is for REG command not REGEDIT
      y>reg export HKLM cmd.reg Operation completed succesfully. lt@MC-TAVIANI:y>perl -e "system qq(reg export HKLM perl.reg)" Operation completed succesfully. y>dir *.reg Directory y:\ 06/03/2015 08:54 191.906.582 cmd.reg 06/03/2015 08:54 191.906.582 perl.reg
      Anyway you can simply do something to dump all root keys:
      my @rootk = qw(HKLM HKCU HKU HKCR); foreach my $root ( @rootk ) { my $ile = $root.'.reg'; system qq(reg export $root $file); }
      That said untill now there is nothing about Perl in this thread.. So if we want something perlish as solution you can try Win32::TieRegistry: is stable, updated, and i use it since 10+ years to remotely create ODBC on winz systems. Looping all the keys with Win32::TieRegistry (or the name is Win32::TyeRegistry ? ;=) ) and write a Config::INI file, double quoting all strings, seems a feasible way

      HtH
      L*
      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
        @L* Thank you for the suggestion. The registry dump is not for me but a third party which needs it for further investigation. So I prefer regedit /e, but maybe it's time for something new.... I think they only need one key I know the Win32::TieRegistry and start using it two months ago. Great module to extract all kind of data from M$

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1118854]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-23 23:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found