Loading ...
Sorry, an error occurred while loading the content.

Registry Browser (Notetab+Perl)

Expand Messages
  • Sheri
    These clips can be viewed and copied without broken lines around http://groups.yahoo.com/group/ntb-scripts/messages/209?expand=1 All three clips should be
    Message 1 of 17 , May 12, 2003
    • 0 Attachment
      These clips can be viewed and copied without broken lines around

      http://groups.yahoo.com/group/ntb-scripts/messages/209?expand=1

      All three clips should be copied to the same library.

      H="Browse Registry via Perl"
      ;Created by Sheri Pierce 5/10/03
      ^!Info This clip captures the currently selected subkey branch and value key name on the clipboard.
      :Start
      ^!Set %Branch%=""
      ^!Set %curdoc%="^$GetDocName$"
      ^!SetWizardLabel
      ^!Set %Root%=HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS
      ;^!IfFalse ^$IsEmpty(^%Branch%)$ Next Else Skip_1
      ;^!Append %Root%=_^%Branch%
      ^!Set %Branch%="^?{(T=L;H=5)Enter Registry Branch=^%Root%}"
      ^!IfCancel Out
      ^!SetClipboard ^%Branch%
      :PerlSubs
      ^!Setscreenupdate off
      ^!Menu File/New
      ^!Keyboard SPACEBAR
      ^!Set %PassBranch%="^$StrReplace("\";"\\";"^%Branch%";No;No)$"
      ^!Set %PassBranch%="^$StrReplace("^%Space%";"grx_grx";"^%PassBranch%";No;No)$"
      ^!RunScript "^$GetPerlExe$ ^1 ^%PassBranch%" "PerlRegScript"
      ^!IfFileExist ^$GetAppPath$StdError.err PerlError
      ^!SetListDelimiter XSEPX^P
      ^!SetArray %SubsandVals%="^$StrTrim("^$GetText$")$"
      ^!Clip "BrowseRegSubClip"
      ^!DestroyDoc
      ^!SetDocIndex=^$GetDocIndex("^%curdoc%")$
      :ShowSubs
      ^!Set %count%=0
      ^!Set %choices%=""
      ^!If ^$StrPos("\";"^%Branch%";No)$>0 ^!Set %choices%="Up a level|"
      :Loop
      ^!Inc %count%
      ^!If ^%count%>^%Subkeys0% Doit
      ^!Append %choices% ^%Subkeys^%count%%|
      ^!Goto Loop
      :Doit
      ^!SetWizardLabel ^%Branch%
      ^!Set %oldchosen%=^%chosen%
      ^!Set %chosen%=^?{(T=L;H=15)Select a key=^%choices%}
      ^!IfCancel Out
      ^!If ^%chosen%="Up a level" Up_Level
      ^!IfMatch "Show the \d+ Value Keys" "^%chosen%" ShowVals
      ^!Set %Branch%="^%Branch%\^%chosen%"
      ^!SetClipboard ^%Branch%
      ^!Goto PerlSubs
      :Up_Level
      ^!Set %size%=^$StrSize("^%Branch%")$
      ^!Set %LastSlash%=^$StrPosRight("\";"^%Branch%";No)$
      ^!If ^%LastSlash%=0 Root
      ^!Set %Branch%=^$StrDeleteRight("^%Branch%";^$Calc(^%size%-^%LastSlash%+1)$)$
      ^!Goto PerlSubs
      :Root
      ^!Set %Branch%=""
      ^!Goto Start
      :ShowVals
      ^!Set %count%=0
      ^!Set %keychoices%=""
      :LoopVals
      ^!Inc %count%
      ^!If ^%count%>^%Valkeys0% Dovals
      ^!Append %keychoices% ^%Valkeys^%count%%|
      ^!Goto LoopVals
      :Dovals
      ^!Set %key%=^?{Select key==^%keychoices%}
      ^!IfCancel Out
      ^!IfMatch "Return to Subkey Branch Display" "^%key%" ShowSubs
      ^!SetClipboard ^%Branch%:^%key%
      ^!Info Registry Value via Notetab GetRegValue (seems to work only when the value contains string or decimal value)^P^P =^P^P ^$GetRegValue("^%Branch%:^%key%")$
      ^!Goto Dovals
      :Out
      ^!Info Reminder: the last used branch and valuekey (if any) is on the clipboard.
      ^!ClearVariable %PassBranch%
      ^!Goto End
      :PerlError
      ^!Info Sorry, there was a Perl Error.
      ^!Open ^$GetAppPath$StdError.err


      H="_BrowseRegSubClip"
      ^!SetListDelimiter ^P
      ^!SetArray %Subkeys%=^%SubsandVals1%
      ^!SetArray %Valkeys%=^%SubsandVals2%


      H="_PerlRegScript"
      use strict;
      use Win32::TieRegistry;
      my $Branch=$ARGV[0];
      #reinsert spaces into branch
      $Branch =~ s/grx_grx/ /g;
      my ($key, $valcount, @names, @namesunsort, @subbranches, @subbranches_unsort, $subkeycount);
      my $keyq = qq(new Win32::TieRegistry "$Branch");
      $key = eval($keyq);
      #convert to familiar slashes for printing branch name
      $Branch =~ s/\\\\/\\/g;
      @namesunsort = $key->ValueNames;
      @names = sort(@namesunsort);
      $valcount=@names;
      if ($valcount>0) {print "Show the $valcount Value Keys\n";}
      @subbranches_unsort = $key->SubKeyNames;
      @subbranches = sort(@subbranches_unsort);
      $subkeycount = @subbranches;
      #Problem! $subkeycount isn't working
      if ($subkeycount = 0) {print "No Subkey Branches Found\n";}
      else {
      foreach $_(@subbranches){
      print;
      print "\n";
      }
      }
      if ($valcount>0) {
      print "XSEPX\n";
      print "Return to Subkey Branch Display\n";
      foreach $_(@names){
      print;
      print "\n";
      }
      }
      #end
    • acummingsus
      Hi Sheri, ... That line, near halfway down the _PerlRegScript, the line is truncated. Evidently yahgroup machinery decided it be someone s email address that
      Message 2 of 17 , May 12, 2003
      • 0 Attachment
        Hi Sheri,

        > $valcount=@names;

        That line, near halfway down the _PerlRegScript, the line is
        truncated.

        Evidently yahgroup machinery decided it be someone's email address
        that their identity needed protected. It shows up as

        (i substituted a # for the @)

        shows up as

        $valcount=#n . . . ;

        Oddly, the line showed in full ($valcount=#names;) when I hit the
        reply button (I now at yahoo web interface as my isp's mail server is
        momentarily in a hiccup)

        I hope that was the only occurrence and that #names is right as far
        as the correction goes (swap in an @ for the #)

        Thanks!

        --
        Alan.
      • Sheri
        Hi Alan, I made a few changes. Now passing the branch from clip to Perl via the document . Even after I got ARGV to work thanks to substituted
        Message 3 of 17 , May 12, 2003
        • 0 Attachment
          Hi Alan,

          I made a few changes. Now passing the branch from clip to Perl via the document <STDIN>. Even after I got ARGV to work thanks to substituted characters, I found there is still a potential problem using ARGV at least under Win98. I.E., the possibility the command line could be too long. Also made a slight enhancement allowing the choice of "Up to Root" from one of the primary branches.

          Did you notice the needed eval?
          >my $keyq = qq(new Win32::TieRegistry "$Branch");
          >$key = eval($keyq);

          This is because it wouldn't work with anything like:
          new Win32::TieRegistry $Branch;

          >> $valcount=@names;
          >
          >That line, near halfway down the _PerlRegScript, the line is
          >truncated.

          Thanks for pointing that out, I spaced it out this time!

          I noticed something unexpected about the Perl sorted lists, they're not really alphabetical. Capitalized member names precede ones in lower case. Hmmn.

          Regards,
          Sheri


          H="Browse Registry via Perl"
          ;Created by Sheri Pierce 5/10/03
          ;modified 5/12/03
          ^!Info This clip captures the currently selected subkey branch and value key name on the clipboard.
          :Start
          ^!Set %Branch%=""
          ^!Set %curdoc%="^$GetDocName$"
          ^!SetWizardLabel
          ^!Set %Root%=HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS
          ^!Set %Branch%="^?{(T=L;H=5)Enter Registry Branch=^%Root%}"
          ^!IfCancel Out
          ^!SetClipboard ^%Branch%
          :PerlSubs
          ^!Setscreenupdate off
          ^!Menu File/New
          ^!InsertText ^%Branch%
          ^!RunPerl "PerlRegScript"
          ^!IfFileExist ^$GetAppPath$StdError.err PerlError
          ^!SetListDelimiter XSEPX^P
          ^!SetArray %SubsandVals%="^$StrTrim("^$GetText$")$"
          ^!Clip "BrowseRegSubClip"
          ^!DestroyDoc
          ^!SetDocIndex=^$GetDocIndex("^%curdoc%")$
          :ShowSubs
          ^!Set %count%=0
          ^!Set %choices%=""
          ^!If ^$StrPos("\";"^%Branch%";No)$>0 Next Else Skip_2
          ^!Set %choices%="Up a level|"
          ^!Goto Loop
          ^!Set %choices%="Up to Root|"
          :Loop
          ^!Inc %count%
          ^!If ^%count%>^%Subkeys0% Doit
          ^!Append %choices% ^%Subkeys^%count%%|
          ^!Goto Loop
          :Doit
          ^!SetWizardLabel ^%Branch%
          ^!Set %oldchosen%=^%chosen%
          ^!Set %chosen%=^?{(T=L;H=15)Select a key=^%choices%}
          ^!IfCancel Out
          ^!If ^%chosen%="Up a level" Up_Level
          ^!If ^%chosen%="Up to Root" Start
          ^!IfMatch "Show the \d+ Value Keys" "^%chosen%" ShowVals
          ^!Set %Branch%="^%Branch%\^%chosen%"
          ^!SetClipboard ^%Branch%
          ^!Goto PerlSubs
          :Up_Level
          ^!Set %size%=^$StrSize("^%Branch%")$
          ^!Set %LastSlash%=^$StrPosRight("\";"^%Branch%";No)$
          ^!If ^%LastSlash%=0 Root
          ^!Set %Branch%=^$StrDeleteRight("^%Branch%";^$Calc(^%size%-^%LastSlash%+1)$)$
          ^!Goto PerlSubs
          :Root
          ^!Set %Branch%=""
          ^!Goto Start
          :ShowVals
          ^!Set %count%=0
          ^!Set %keychoices%=""
          :LoopVals
          ^!Inc %count%
          ^!If ^%count%>^%Valkeys0% Dovals
          ^!Append %keychoices% ^%Valkeys^%count%%|
          ^!Goto LoopVals
          :Dovals
          ^!Set %key%=^?{Select key==^%keychoices%}
          ^!IfCancel Out
          ^!IfMatch "Return to Subkey Branch Display" "^%key%" ShowSubs
          ^!SetClipboard ^%Branch%:^%key%
          ^!Info Registry Value via Notetab GetRegValue (seems to work only when the value contains string or decimal value)^P^P =^P^P ^$GetRegValue("^%Branch%:^%key%")$
          ^!Goto Dovals
          :Out
          ^!Info Reminder: the last used branch and valuekey (if any) is on the clipboard.
          ^!Goto End
          :PerlError
          ^!Info Sorry, there was a Perl Error.
          ^!Open ^$GetAppPath$StdError.err


          H="_BrowseRegSubClip"
          ^!SetListDelimiter ^P
          ^!SetArray %Subkeys%=^%SubsandVals1%
          ^!SetArray %Valkeys%=^%SubsandVals2%


          H="_PerlRegScript"
          #modified 5/12/03
          use strict;
          use Win32::TieRegistry;
          #my $Branch=$ARGV[0];
          my $Branch = <STDIN>;
          chomp $Branch;
          #double up slashes for use in tieregistry
          $Branch =~ s/\\/\\\\/g;
          my ($key, $valcount, @names, @namesunsort, @subbranches, @subbranches_unsort, $subkeycount);
          my $keyq = qq(new Win32::TieRegistry "$Branch");
          $key = eval($keyq);
          #convert to familiar slashes for printing branch name
          $Branch =~ s/\\\\/\\/g;
          @namesunsort = $key->ValueNames;
          @names = sort(@namesunsort);
          $valcount = @names;
          if ($valcount>0) {print "Show the $valcount Value Keys\n";}
          @subbranches_unsort = $key->SubKeyNames;
          @subbranches = sort(@subbranches_unsort);
          $subkeycount = @subbranches;
          #Problem! $subkeycount isn't working
          if ($subkeycount = 0) {print "No Subkey Branches Found\n";}
          else {
          foreach $_(@subbranches){
          print;
          print "\n";
          }
          }
          if ($valcount>0) {
          print "XSEPX\n";
          print "Return to Subkey Branch Display\n";
          foreach $_(@names){
          print;
          print "\n";
          }
          }
          #end of script


          At 09:25 PM 5/12/03 +0000, you wrote:
          >Hi Sheri,
          >
          >> $valcount=@names;
          >
          >That line, near halfway down the _PerlRegScript, the line is
          >truncated.
          >
          >Evidently yahgroup machinery decided it be someone's email address
          >that their identity needed protected. It shows up as
          >
          >(i substituted a # for the @)
          >
          >shows up as
          >
          >$valcount=#n . . . ;
          >
          >Oddly, the line showed in full ($valcount=#names;) when I hit the
          >reply button (I now at yahoo web interface as my isp's mail server is
          >momentarily in a hiccup)
          >
          >I hope that was the only occurrence and that #names is right as far
          >as the correction goes (swap in an @ for the #)
          >
          >Thanks!
          >
          >--
          >Alan.
          >
          >
          >
          >
          >ntb-scripts-unsubscribe@yahoogroups.com
          >
          >
          >
          >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        • acummingsus
          All day havin trouble with my isp s mail sys. Cwnet isp in Sacramento California area spread the word around. Other than their mail their service is fine.
          Message 4 of 17 , May 12, 2003
          • 0 Attachment
            All day havin trouble with my isp's mail sys. Cwnet isp in
            Sacramento California area spread the word around. Other than their
            mail their service is fine. I think they need to hire a new server
            admin or whoever manage their mail server system.

            I know what forwarding is their server refuses in accusation that no
            forwarding allowed (current erroneous thing of theirs that holds up
            and delays me) so here i posting from yahgruop web interface again.

            On Mon, 12 May 2003 21:10:27 -0400, Sheri wrote:
            >Hi Alan,
            >
            >I made a few changes. Now passing the branch from clip to Perl via
            >the document <STDIN>. Even after I got ARGV to work thanks to
            >substituted characters, I found there is still a potential problem
            >using ARGV at least under Win98. I.E., the possibility the command
            >line could be too long. Also made a slight enhancement allowing the
            >choice of "Up to Root" from one of the primary branches.

            <STDIN> normally would be keyboard input--but it is like a file
            handle onto a file, just happens that it's a keyboard input
            filehandle.

            It appears that the NoteTab runperl command then must use that as a
            filehandle onto a file, the current doc file in NoteTab.

            In Perl circles, I've never heard anyone report they source from a
            doc as input. It's always open a filehandle on a file or use the
            commandline or once the perl script is running, prompt and take input
            via the keyboard which normally feeds into the <STDIN>.

            Ya I previously ran into the commandline space issue, did what you
            did, substitute in ntb with something weird then in Perl, substitute
            back to the space or spaces.

            I put a goto end just before your destroy doc and I could see the
            keys or whatever its called that were dumped into the doc.

            I haven't had time yet to tinker with the module. Sometimes when I
            do, I get something worthwhile working out of my effort. Other
            times, I don't even get it to work.

            I had the idea to use getdosoutput and just wrap that around a
            command. But that's limited to the command line. Perhaps this other
            is better perhaps it is using a file handle that has been opened

            I still need to learn a bunch more. The Linux class currently really
            drawing demand on my time

            your clip/script worked good on my Win 2k computer.
            >
            >Did you notice the needed eval?

            I saw it in there. I don't know enough about it why it would be
            needed or not.

            FWIW the cpan web page for the module shows this:

            Changing your delimiter

            $Registry->Delimiter("/");
            $tip18= $Registry->{"HKEY_LOCAL_MACHINE/Software/Microsoft/"
            . 'Windows/CurrentVersion/Explorer/Tips//18'};


            This usually makes things easier to read when working in Perl. All
            remaining examples will assume the delimiter has been changed as
            above.
            ;-----end snippet from web page----------

            I was hoping the module has capability to search the registry for
            something say some keywords entered then return whatever found and
            then ability to select from found items then command it to pull
            content of those found keys or branches. But maybe I dont know enuf
            about it perhaps the registry not even constructed in a manner
            conducive to that.

            I hope in tinkering with this stuff to learn more about Perl and the
            win32 registry and data storage methods since registry does storage.

            I dunno enuf about the registry either. I wonder if another registry
            could be created on the hard drive and used as a data base

            Thanks.

            --
            Alan.
          • Sheri
            Hi Alan, I hope your isp probs are improving... ... Prior to using multi-d arrays in the clip, I needed a separate Perl script to access values vs subbranches.
            Message 5 of 17 , May 13, 2003
            • 0 Attachment
              Hi Alan,

              I hope your isp probs are improving...

              At 05:55 AM 5/13/03 +0000, you wrote:
              > I put a goto end just before your destroy doc and I could
              > see the keys or whatever its called that were dumped into
              > the doc.

              Prior to using multi-d arrays in the clip, I needed a
              separate Perl script to access values vs subbranches. Its
              much more convenient to get them all at once. I see in
              some clips multiple ^!SetListDelimiter statements work ok.
              Try moving my sub-clip statements into the main clip and
              see what you make of the error.

              > your clip/script worked good on my Win 2k computer.

              Did you get a chance to try the other one, the custom
              function? I was curious if it works on winvers > 98se.

              >> Did you notice the needed eval?
              >
              > I saw it in there. I don't know enough about it why it
              > would be needed or not.
              >
              > FWIW the cpan web page for the module shows this:
              >
              > Changing your delimiter
              >
              > $Registry->Delimiter("/");
              > $tip18= $Registry->{"HKEY_LOCAL_MACHINE/Software/Microsoft/"
              > . 'Windows/CurrentVersion/Explorer/Tips//18'};
              >
              >
              > This usually makes things easier to read when working in
              > Perl. All remaining examples will assume the delimiter has
              > been changed as above.
              > ;-----end snippet from web page----------
              >
              > I was hoping the module has capability to search the
              > registry for something say some keywords entered then
              > return whatever found and then ability to select from
              > found items then command it to pull content of those found
              > keys or branches. But maybe I dont know enuf about it
              > perhaps the registry not even constructed in a manner
              > conducive to that.

              I think the CPAN page you cited is the same as the Perldoc
              for Win32::TieRegistry. In part it also says: "Note that
              you will most likely use $Registry instead of using a tied
              hash. $Registry is a reference to a hash that has been
              tied to the virtual root of your computer's Registry [as
              if, $Registry= \%RegHash]."

              I was never able to get the variable $Registry variable to
              work. :(

              I was experimenting with this module around the same time
              I succeeded with Config::IniFiles. I normally pass any
              parameters from a clip to Perl via my own clip-written ini
              file and use Config::IniFiles to read it in Perl, but in
              this case was trying to avoid dependence on extra modules.

              Regards,
              Sheri
            • Sheri
              ... Hi Hugo, (I hope you don t mind, I am copying this reply to the scripts list. There is so little traffic there, I m hoping your comments will encourage
              Message 6 of 17 , May 13, 2003
              • 0 Attachment
                At 01:25 PM 5/13/03 +0000, you wrote:

                >> Did you get a chance to try the other one, the custom
                >> function? I was curious if it works on winvers > 98se.
                >>
                >
                >Sheri,
                >
                >I ran your original clip on Win XP Pro at home yesterday. After some
                >tweaking (Alan's remark about @names...) it ran OK. Beautiful clip(s).
                >
                >But I have a question about the purpose of the clip: why on earth
                >would I want to see these registry-file details. When could that come
                >in handy? And: the result is shown in a document, but what can I do
                >with these details/deduct from that? Forgive my ignorance, I never
                >use the registry, only clean it from time to time - just curious.
                >
                >Hugo


                Hi Hugo,

                (I hope you don't mind, I am copying this reply to the
                scripts list. There is so little traffic there, I'm hoping
                your comments will encourage others to speak up.)

                Thanks for the comments!

                About the only way I see it being useful is if you were
                using Notetab as a programming editor. Maybe if you needed
                to paste a branch/key name into your program and wanted to
                avoid typos....?

                It would certainly be just as easy to launch a real
                registry editor. I put this clip in the category of
                showing something can be done, whether it makes sense or
                not <g>. The clip could be easily modified to start from
                some branch of particular interest. In that case maybe the
                clip would be more convenient than a registry editor.

                >And: the result is shown in a document, but what can I do
                >with these details/deduct from that?

                Not sure I understand what you mean by that. Did you mean
                clip wizard instead of document? Are you referring to the
                custom function or the Perl driven clip ((Alan's remark
                about @names refers to that one, or was there a similar
                problem with the custom function one?).

                Regards,
                Sheri
              • H.Paulissen@FDCW.unimaas.nl
                Sheri, ... Not at all... ... OK ... In a way you answered that already. I was not referring to the output being in a document, but to the actual output
                Message 7 of 17 , May 13, 2003
                • 0 Attachment
                  Sheri,

                  >
                  > (I hope you don't mind, I am copying this reply to the
                  > scripts list. There is so little traffic there, I'm hoping
                  > your comments will encourage others to speak up.)

                  Not at all...

                  >
                  > Thanks for the comments!
                  >
                  > About the only way I see it being useful is if you were
                  > using Notetab as a programming editor. Maybe if you needed
                  > to paste a branch/key name into your program and wanted to
                  > avoid typos....?

                  OK

                  > >And: the result is shown in a document, but what can I do
                  > >with these details/deduct from that?
                  >
                  > Not sure I understand what you mean by that. Did you mean
                  > clip wizard instead of document? Are you referring to the
                  > custom function or the Perl driven clip ((Alan's remark
                  > about @names refers to that one, or was there a similar
                  > problem with the custom function one?).
                  >

                  In a way you answered that already. I was not referring to the output being
                  in a document, but to the actual output itself...

                  What I meant was: Nice to know that this registry-subvalue is 1788889 (or
                  whatever?) - but what should I do with this knowledge
                  ?

                  Oh well, never mind, you said it was an almost useless clip <bg>.

                  >
                  > It would certainly be just as easy to launch a real
                  > registry editor. I put this clip in the category of
                  > showing something can be done, whether it makes sense or
                  > not <g>.
                  >

                  Hugo
                • Sheri
                  Hi Hugo, ... Well, I guess if the particular registry-subvalue is the one a programmer makes use of, s/he knows what 1788889 means It would be a constant
                  Message 8 of 17 , May 13, 2003
                  • 0 Attachment
                    Hi Hugo,

                    At 04:16 PM 5/13/03 +0200, you wrote:

                    >What I meant was: Nice to know that this registry-subvalue is 1788889 (or
                    >whatever?) - but what should I do with this knowledge
                    >?

                    Well, I guess if the particular registry-subvalue is the one a programmer makes use of, s/he knows what 1788889 means <G>

                    It would be a constant your clip or program could assign to a variable.

                    I just remembered I once used the current screen resolution in an AutoIt script. It was in the registry at

                    Branch: HKEY_CURRENT_CONFIG\Display\Settings
                    Key: Resolution

                    So now (opening a can of worms), I see I don't have HKEY_CURRENT_CONFIG in my set of root choices, so I just added it. Then I used the clip to browse to and select the Resolution key. I discovered that Notetab's ^$GetRegValue$ wouldn't read it or any other value in HKEY_CURRENT_CONFIG. I have no explanation - might be a bug in ^$GetRegValue$. :(

                    Regards,
                    Sheri
                  • Alan C.
                    On Tue, 13 May 2003 09:16:09 -0400, Sheri wrote: Hi Sheri and Hugo,
                    Message 9 of 17 , May 14, 2003
                    • 0 Attachment
                      On Tue, 13 May 2003 09:16:09 -0400, Sheri wrote:

                      Hi Sheri and Hugo,

                      http://aspn.activestate.com/ASPN/search?query=win32%3A%3Atieregistry&type=Archive_perl-win32-admin_list&x=17&y=3

                      That some admin uses of Win32::TieRegistry
                      look like that and programming the primary uses of the module

                      >I hope your isp probs are improving...
                      it a little better now.

                      >Did you get a chance to try the other one, the custom
                      >function? I was curious if it works on winvers >�98se.

                      Just did. Win 2k. Works fine on the first recurse it lists subs as well as the data or value of a key. But after choosing a key then it reports the value of key is:

                      and its blank, nothing listed for value. i look regedit there's two values in the key that i picked with your clip

                      I just spent near two hours trying to get something out of win32::tieregistry and i didn't even get it to work at all. i was just a .pl script file with stuff hard coded then in command console: perl tiereg.pl

                      nada, nothing. (it's due to my experience level not sufficient for the task)

                      i found out that tie in Perl is where like an auto array building ie if reading a folder of files then the tie "pushes" each file onto the front of the array (until all files are read into the array).

                      I'm sure the module capability, utilizes that and can read portion of a reg branch and print out keys, sub keys, and values.

                      I opened win32::tieregistry in NoteTab. It defines shortcuts for the main reg branches ie Lmachine can use instead of the longer hkey_local_machine

                      Anything such as that and others created therein is available in the main current package namespace or whatever it's called (use whatever_module;) as I'm sure you know brings that stuff into the current namespace.

                      there is an older win32::registry module deprecated recommend use win3::tieregistry both are on my activestate perl 61 build 633

                      --
                      Alan.
                    • Alan C.
                      Woop woop I m all excited! I just got Win32::TieRegistry to work! I found more about it http://www.xav.com/perl/site/lib/Win32/TieRegistry.html clicked on
                      Message 10 of 17 , May 14, 2003
                      • 0 Attachment
                        Woop woop

                        I'm all excited! I just got Win32::TieRegistry to work!

                        I found more about it

                        http://www.xav.com/perl/site/lib/Win32/TieRegistry.html

                        clicked on "specifying constants in your perl code" (code sample below came from there)

                        the single / works and everything!

                        But I still don't know how to READ :-(

                        The next creates a few new keys (i then examined them with regedit and then used regedit to delete them) was harmless on my win 2k.

                        Be forwarned: to create the wrong type key in the wrong place in the registry can spell disaster!

                        #!perl -w
                        use strict;
                        my $Registry;
                        use Win32::TieRegistry 0.24 (
                        TiedRef => \$Registry, Delimiter => "/", ArrayValues => 1,
                        SplitMultis => 1, AllowLoad => 1,
                        qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ
                        KEY_READ KEY_WRITE KEY_ALL_ACCESS ),
                        );
                        $Registry->{"LMachine/Software/FooCorp/"}= {
                        "FooWriter/" => {
                        "/Fonts" => [ ["Times","Courier","Lucinda"], REG_MULTI_SZ ],
                        "/WindowSize" => [ pack("LL",24,80), REG_BINARY ],
                        "/TaskBarIcon" => [ "0x0001", REG_DWORD ],
                        },
                        } or die "Can't create Software/FooCorp/: $^E\n";

                        --
                        Later. Alan.
                      • Sheri
                        Hi Alan, ... Hmmn. That one isn t supposed to be listing subs. You supply the sub, it lists the key names in a clip wizard. Were you running my Test
                        Message 11 of 17 , May 14, 2003
                        • 0 Attachment
                          Hi Alan,

                          At 01:06 AM 5/14/03 -0700, you wrote:

                          >>Did you get a chance to try the other one, the custom
                          >>function? I was curious if it works on winvers > 98se.
                          >
                          >Just did. Win 2k. Works fine on the first recurse it lists subs as well as the data or value of a key.

                          Hmmn. That one isn't supposed to be listing subs. You supply the sub, it lists the key names in a clip wizard. Were you running my "Test GetRegSubKeys" ?

                          >But after choosing a key then it reports the value of key is:
                          >
                          >and its blank, nothing listed for value. i look regedit there's two values in the key that i picked with your clip

                          Two values in a key? Maybe is a type the Notetab ^$GetRegValue$ function doesn't read.

                          >I just spent near two hours trying to get something out of win32::tieregistry and i didn't even get it to work at all. i was just a .pl script file with stuff hard coded then in command console: perl tiereg.pl
                          >
                          >nada, nothing. (it's due to my experience level not sufficient for the task)

                          That bites doesn't it <g>

                          >i found out that tie in Perl is where like an auto array building ie if reading a folder of files then the tie "pushes" each file onto the front of the array (until all files are read into the array).
                          >
                          >I'm sure the module capability, utilizes that and can read portion of a reg branch and print out keys, sub keys, and values.
                          >
                          >I opened win32::tieregistry in NoteTab. It defines shortcuts for the main reg branches ie Lmachine can use instead of the longer hkey_local_machine

                          Yes, but not a good idea for clip integration that doesn't recognize the shortcuts. Speaking of shortcuts, I read yesterday that HKEY_CURRENT_CONFIG, whose keys Notetab's ^$GetRegValue$ won't read, is a shortcut for HKEY_LOCAL_MACHINE\Config. On my computer I found HKEY_LOCAL_MACHINE\Config\0001\etc seems to have the same branches and keys as HKEY_CURRENT_CONFIG\etc.

                          Notetab's ^$GetRegValue$ function works fine when using the HKEY_LOCAL_MACHINE\Config\0001\etc key info.

                          Regards,
                          Sheri
                        • Sheri
                          Hi Alan, ... Congratulations! ... If by that you mean read a value using Perl instead on Notetab s ^$GetRegValue$, I was able to do it in my script (that
                          Message 12 of 17 , May 14, 2003
                          • 0 Attachment
                            Hi Alan,

                            At 01:32 AM 5/14/03 -0700, you wrote:
                            >Woop woop
                            >
                            >I'm all excited! I just got Win32::TieRegistry to work!


                            Congratulations!


                            >I found more about it
                            >
                            >http://www.xav.com/perl/site/lib/Win32/TieRegistry.html
                            >
                            >clicked on "specifying constants in your perl code" (code sample below came from there)
                            >
                            >the single / works and everything!
                            >
                            >But I still don't know how to READ :-(

                            If by that you mean read a value using Perl instead on Notetab's ^$GetRegValue$, I was able to do it in my script (that doesn't use $Registry) using

                            ($valueString,$valuetype) = $key->GetValue("$valname");

                            Unfortunately, the clip won't resume after perl if I use print $valueString and its the wrong type of data, e.g., $valuetype 3 seems to be Binary.


                            >The next creates a few new keys (i then examined them with regedit and then used regedit to delete them) was harmless on my win 2k.
                            >
                            >Be forwarned: to create the wrong type key in the wrong place in the registry can spell disaster!

                            LOL! I should run it after such a warning? <G>

                            Well, maybe later.

                            Sheri :)
                          • Sheri
                            Hi Alan, OK, I tried your script and it worked fine. Then used my clip/script (now enhanced to use GetValue() when Notetab ^$GetRegValue$ returns an empty
                            Message 13 of 17 , May 14, 2003
                            • 0 Attachment
                              Hi Alan,

                              OK, I tried your script and it worked fine.

                              Then used my clip/script (now enhanced to use GetValue() when Notetab ^$GetRegValue$ returns an empty string) to try to read the 3 new keys. The only one that didn't crash the clip (by trying to print unacceptable data to a Notetab doc I suppose) was TaskBarIcon. I was reading the data type as numeric. I read in the perldoc that if you install module "SetDualVar" it will return the constant name of the data type. So I installed SetDualVar, and that works (but numeric test also seems to still work). I know for sure that REG_BINARY (type 3) and REG_MULTI_SZ (type 7) ones can't print to Notetab so those are excluded (report data type only).

                              H="Browse Registry via Perl"
                              ;Created by Sheri Pierce 5/10/03
                              ;5/14/03 version
                              ^!Info This clip captures the currently selected subkey branch and value key name on the clipboard.
                              :Start
                              ^!Set %Branch%=""
                              ^!Set %curdoc%="^$GetDocName$"
                              ^!SetWizardLabel
                              ^!Set %Root%=HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKEY_CURRENT_CONFIG
                              ^!Set %Branch%="^?{(T=L;H=5)Enter Registry Branch=^%Root%}"
                              ^!IfCancel Out
                              ^!SetClipboard ^%Branch%
                              :PerlSubs
                              ^!Setscreenupdate off
                              ^!Menu File/New
                              ^!InsertText ^%Branch%
                              ^!RunPerl "PerlRegScript"
                              ^!IfFileExist ^$GetAppPath$StdError.err PerlError
                              ^!SetListDelimiter XSEPX^P
                              ^!SetArray %SubsandVals%="^$StrTrim("^$GetText$")$"
                              ^!Clip "BrowseRegSubClip"
                              ^!DestroyDoc
                              ^!SetDocIndex=^$GetDocIndex("^%curdoc%")$
                              :ShowSubs
                              ^!Set %count%=0
                              ^!Set %choices%=""
                              ^!If ^$StrPos("\";"^%Branch%";No)$>0 Next Else Skip_2
                              ^!Set %choices%="Up a level|"
                              ^!Goto Loop
                              ^!Set %choices%="Up to Root|"
                              :Loop
                              ^!Inc %count%
                              ^!If ^%count%>^%Subkeys0% Doit
                              ^!Append %choices% ^%Subkeys^%count%%|
                              ^!Goto Loop
                              :Doit
                              ^!SetWizardLabel ^%Branch%
                              ^!Set %oldchosen%=^%chosen%
                              ^!Set %chosen%=^?{(T=L;H=15)Select a key=^%choices%}
                              ^!IfCancel Out
                              ^!If ^%chosen%="Up a level" Up_Level
                              ^!If ^%chosen%="Up to Root" Start
                              ^!IfMatch "Show the \d+ Value Keys" "^%chosen%" ShowVals
                              ^!Set %Branch%="^%Branch%\^%chosen%"
                              ^!SetClipboard ^%Branch%
                              ^!Goto PerlSubs
                              :Up_Level
                              ^!Set %size%=^$StrSize("^%Branch%")$
                              ^!Set %LastSlash%=^$StrPosRight("\";"^%Branch%";No)$
                              ^!If ^%LastSlash%=0 Root
                              ^!Set %Branch%=^$StrDeleteRight("^%Branch%";^$Calc(^%size%-^%LastSlash%+1)$)$
                              ^!Goto PerlSubs
                              :Root
                              ^!Set %Branch%=""
                              ^!Goto Start
                              :ShowVals
                              ^!Set %count%=0
                              ^!Set %keychoices%=""
                              :LoopVals
                              ^!Inc %count%
                              ^!If ^%count%>^%Valkeys0% Dovals
                              ^!Append %keychoices% ^%Valkeys^%count%%|
                              ^!Goto LoopVals
                              :Dovals
                              ^!Set %key%=^?{Select key==^%keychoices%}
                              ^!IfCancel Out
                              ^!IfMatch "Return to Subkey Branch Display" "^%key%" ShowSubs
                              ^!SetClipboard ^%Branch%:^%key%
                              ^!IfTrue ^$IsEmpty(^$GetRegValue("^%Branch%:^%key%")$)$ Next Else NTInfo
                              ^!Setdebug on
                              :PerlInfo
                              ^!Menu File/New
                              ^!InsertText ^%Branch%::^%key%
                              ^!RunPerl "PerlRegValScript"
                              ^!Set %ValViaPerl%=^$StrTrim(^$GetText$)$
                              ^!IfFileExist ^$GetAppPath$StdError.err PerlError
                              ^!DestroyDoc
                              ^!SetDocIndex=^$GetDocIndex("^%curdoc%")$
                              ^!Info Notetab's ^$GetRegValue$ command doesn't read this key!^PRegistry Value via Perl^P^P=^P^P^%ValViaPerl%
                              ^!Goto Dovals
                              :NTInfo
                              ^!Info Registry Value via Notetab GetRegValue (seems to work only when the value contains string or decimal value)^P^P =^P^P ^$GetRegValue("^%Branch%:^%key%")$
                              ^!Goto Dovals
                              :Out
                              ^!Info Reminder: the last used branch and valuekey (if any) is on the clipboard.
                              ^!ClearVariable %PassBranch%
                              ^!Goto End
                              :PerlError
                              ^!Info Sorry, there was a Perl Error.
                              ^!Open ^$GetAppPath$StdError.err


                              H="_BrowseRegSubClip"
                              ^!SetListDelimiter ^P
                              ^!SetArray %Subkeys%=^%SubsandVals1%
                              ^!SetArray %Valkeys%=^%SubsandVals2%


                              H="_PerlRegScript"
                              #;5/14/03 version
                              use strict;
                              use Win32::TieRegistry;
                              #my $Branch=$ARGV[0];
                              my $Branch = <STDIN>;
                              chomp $Branch;
                              #double up slashes for use in tieregistry
                              $Branch =~ s/\\/\\\\/g;
                              my ($key, $valcount, @names, @namesunsort, @subbranches, @subbranches_unsort, $subkeycount);
                              my $keyq = qq(new Win32::TieRegistry "$Branch");
                              $key = eval($keyq);
                              #convert to familiar slashes for printing branch name
                              $Branch =~ s/\\\\/\\/g;
                              @namesunsort = $key->ValueNames;
                              @names = sort(@namesunsort);
                              $valcount = @names;
                              if ($valcount>0) {print "Show the $valcount Value Keys\n";}
                              @subbranches_unsort = $key->SubKeyNames;
                              @subbranches = sort(@subbranches_unsort);
                              $subkeycount = @subbranches;
                              #$subkeycount = $key->CntSubKeys;
                              #Problem! $subkeycount isn't working
                              if ($subkeycount = 0) {print "No Subkey Branches Found\n";}
                              else {
                              foreach $_(@subbranches){
                              print;
                              print "\n";
                              }
                              }
                              if ($valcount>0) {
                              print "XSEPX\n";
                              print "Return to Subkey Branch Display\n";
                              foreach $_(@names){
                              print;
                              print "\n";
                              }
                              }


                              H="_PerlRegValScript"
                              #;5/14/03 version
                              use strict;
                              use Win32::TieRegistry;
                              my ($key, $valueString, $valname, $valuetype, $Branch,);
                              #my $Branch=$ARGV[0];
                              #my $Branch = <STDIN>;
                              #chomp $Branch;
                              #double up slashes for use in tieregistry
                              while (<STDIN>) {
                              chomp; # avoid \n on last field
                              ($Branch, $valname) = split(/::/);
                              }
                              $Branch =~ s/\\/\\\\/g;
                              my $keyq = qq(new Win32::TieRegistry "$Branch");
                              $key = eval($keyq);
                              ($valueString,$valuetype) = $key->GetValue("$valname");
                              if ($valuetype == 3) {print "unprintable data, type $valuetype";}
                              elsif ($valuetype == 7) {print "unprintable data, type $valuetype";}
                              else {print "Data type\: ", $valuetype, "\n\nValue\: ", $valueString;}
                              #end of script
                            • Sheri
                              Hi again, ... The following works (just change the regular clips to ^!RunPerl these alt versions instead of the other ones). It has all the same stuff in the
                              Message 14 of 17 , May 14, 2003
                              • 0 Attachment
                                Hi again,

                                At 01:32 AM 5/14/03 -0700, you wrote:
                                >But I still don't know how to READ :-(

                                The following works (just change the regular clips to ^!RunPerl these alt versions instead of the other ones). It has all the same stuff in the use statement as yours, except I quickly discovered problems with using "/" (some subbranches have that in their name) as a delimiter and reverted to "\\". All I had to do was replace all my

                                "$key->" stuff

                                with

                                "$Registry->{"$Branch"}"

                                Doesn't even need the eval anymore; ditto for _AltPerlRegValScript further down.

                                Sheri

                                H="_AltPerlRegScript"
                                #;5/14/03 alternate version
                                use strict;
                                my $Registry;
                                use Win32::TieRegistry 0.24 (
                                TiedRef => \$Registry, Delimiter => "\\\\", ArrayValues => 1,
                                SplitMultis => 1, AllowLoad => 1,
                                qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ
                                KEY_READ KEY_WRITE KEY_ALL_ACCESS ),
                                );
                                #my $Branch=$ARGV[0];
                                my $Branch = <STDIN>;
                                chomp $Branch;
                                #double up slashes for use in tieregistry
                                $Branch =~ s/\\/\\\\/g;
                                my ($key, $valcount, @names, @namesunsort, @subbranches, @subbranches_unsort, $subkeycount);
                                @namesunsort = $Registry->{"$Branch"}->ValueNames;
                                @names = sort(@namesunsort);
                                $valcount = @names;
                                if ($valcount>0) {print "Show the $valcount Value Keys\n";}
                                @subbranches_unsort = $Registry->{"$Branch"}->SubKeyNames;
                                @subbranches = sort(@subbranches_unsort);
                                $subkeycount = @subbranches;
                                #Problem! $subkeycount isn't working
                                if ($subkeycount = 0) {print "No Subkey Branches Found\n";}
                                else {
                                foreach $_(@subbranches){
                                print;
                                print "\n";
                                }
                                }
                                if ($valcount>0) {
                                print "XSEPX\n";
                                print "Return to Subkey Branch Display\n";
                                foreach $_(@names){
                                print;
                                print "\n";
                                }
                                }


                                H="_AltPerlRegValScript"
                                #;5/14/03 alternate version
                                use strict;
                                my $Registry;
                                use Win32::TieRegistry 0.24 (
                                TiedRef => \$Registry, Delimiter => "\\\\", ArrayValues => 1,
                                SplitMultis => 1, AllowLoad => 1,
                                qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ
                                KEY_READ KEY_WRITE KEY_ALL_ACCESS ),
                                );
                                my ($key, $valueString, $valname, $valuetype, $Branch,);
                                #double up slashes for use in tieregistry
                                while (<STDIN>) {
                                chomp; # avoid \n on last field
                                ($Branch, $valname) = split(/::/);
                                }
                                $Branch =~ s/\\/\\\\/g;
                                #my $keyq = qq(new Win32::TieRegistry "$Branch");
                                #$key = eval($keyq);
                                ($valueString,$valuetype) = $Registry->{"$Branch"}->GetValue("$valname");
                                if ($valuetype == 3) {print "unprintable data, type $valuetype";}
                                elsif ($valuetype == 7) {print "unprintable data, type $valuetype";}
                                else {print "Data type\: ", $valuetype, "\n\nValue\: ", $valueString;}
                                #end of script
                              • Alan C.
                                ... Then what s a sub? I thought it be keys and *sub* keys as in Key: hkey_current_user software myalancapps sub key underneath the above key:
                                Message 15 of 17 , May 15, 2003
                                • 0 Attachment
                                  On Wed, 14 May 2003 08:35:41 -0400, Sheri wrote:
                                  >Hi Alan,
                                  >
                                  >At 01:06 AM 5/14/03 -0700, you wrote:
                                  >
                                  >>>Did you get a chance to try the other one, the custom
                                  >>>function? I was curious if it works on winvers >�98se.
                                  >>
                                  >>Just did. �Win 2k. �Works fine on the first recurse it lists subs
                                  >>as well as the data or value of a key.
                                  >
                                  >Hmmn. That one isn't supposed to be listing subs. You supply the
                                  >sub, it lists the key names in a clip wizard.

                                  Then what's a sub? I thought it be keys and *sub* keys as in

                                  Key:
                                  hkey_current_user\software\myalancapps

                                  sub key underneath the above key:
                                  hkey_current_user\software\myalancapps\app1

                                  >Were you running my
                                  >"Test GetRegSubKeys" ?

                                  Yes.

                                  >
                                  >>But after choosing a key then it reports the value of key is:
                                  >>
                                  >>and its blank, nothing listed for value. �i look regedit there's
                                  >>two values in the key that i picked with your clip
                                  >
                                  >Two values in a key? Maybe is a type the Notetab ^$GetRegValue$
                                  >function doesn't read.

                                  (if I have my terminology correct) Seems to me that Perl script the other day that created a few new keys did create that one of the keys created had three separate values in it (yes, some were binary probably unreadable by NoteTab). But,

                                  It was a text value that I was speaking of that your clip displayed on first recurse only.

                                  As I said, it was read on the first of several what I call recurses. For example, here what I did:

                                  Actually it was a key the first time then run the clip. I Hard coded the next into the clip:

                                  hkey_current_user\software\myalancapps

                                  run clip. clip dialog comes up with that in the dialog and selected. Then just ok the dialog. Next comes up yet another dialog that shows the initially entered item (can choose it), also shows (it's here the value and its content is shown) the value (registerednotregistered) AND sub keys so as to choose a sub key

                                  Next, choose from items shown in wizard, choose and ok the same item as initially entered. it's the next dialog is when the listing is blank of any value.

                                  So, this is what I meant by the statement: any value in the hard coded key is listed/shown on first recurse. Choose same key again and the listing/value_shown comes up blank.

                                  (I substituted my name I don't really have an app authored by me) but just to show the structure of the reg keys I ran your clip on:

                                  hkey_current_user\software\myalancapps

                                  hkey_current_user\software\myalancapps\app1

                                  hkey_current_user\software\myalancapps\app1
                                  the value: registeredyesno textdataofyesorno

                                  hkey_current_user\software\myalancapps\app1\tips
                                  the values: several values for tips 2 be displayed


                                  hkey_current_user\software\myalancapps\app2

                                  hkey_current_user\software\myalancapps\app2\tips

                                  --
                                  Alan.
                                • Sheri
                                  Thanks Alan, From what you ve said, I think that the regedit export file must be a little different in Win 2k than my 98. You should only see the names of
                                  Message 16 of 17 , May 15, 2003
                                  • 0 Attachment
                                    Thanks Alan,

                                    From what you've said, I think that the regedit export file must be a little different in Win 2k than my 98.

                                    You should only see the names of Values in that second wizard, and not see or get to select again the branch or any subbranches. (I thought "Value Names" were called "Keys" when I wrote that clip).

                                    I found a glitch in my Perl registry browser too. Turns out "default" Values are unnamed. A ^$StrTrim$ I was using in the clip was removing blank value names.

                                    I've made some more changes in my Perl regbrowser and I'm not sure why, but multi's and binary values retrieved no longer crash the clip. Now multis display as "Array(...)" and binaries just show up blank.

                                    Weird.

                                    Regards,
                                    Sheri
                                  • Sheri
                                    Hi again Alan, Solved the problem of showing multi values such as the fonts entry for FooWriter. Have to refer to the valueString as an array if the data type
                                    Message 17 of 17 , May 16, 2003
                                    • 0 Attachment
                                      Hi again Alan,

                                      Solved the problem of showing multi values such as the fonts entry for FooWriter. Have to refer to the valueString as an array if the data type is REG_MULTI_SZ, i.e., @$valueString.

                                      This version does that and depicts default value names as .Default in clip wizards (but retrieves the actual values using "").

                                      Sheri

                                      H="Browse Registry via Perl"
                                      ;Created by Sheri Pierce 5/10/03
                                      ;5/16/03 version
                                      ^!Info This clip captures the currently selected subkey branch and value key name on the clipboard.
                                      :Start
                                      ^!Set %Branch%=""
                                      ^!Set %curdoc%="^$GetDocName$"
                                      ^!SetWizardLabel
                                      ^!Set %Root%=HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKEY_CURRENT_CONFIG
                                      ^!Set %Branch%="^?{(T=L;H=5)Enter Registry Branch=^%Root%}"
                                      ^!IfCancel Out
                                      ^!SetClipboard ^%Branch%
                                      :PerlSubs
                                      ^!Setscreenupdate off
                                      ^!Menu File/New
                                      ^!InsertText ^%Branch%
                                      ;^!RunPerl "PerlRegScript"
                                      ^!RunPerl "AltPerlRegScript"
                                      ^!IfFileExist ^$GetAppPath$StdError.err PerlError
                                      ^!SetListDelimiter XSEPX^P
                                      ^!SetArray %SubsandVals%="^$StrTrim("^$GetText$")$"
                                      ^!Clip "BrowseRegSubClip"
                                      ^!DestroyDoc
                                      ^!SetDocIndex=^$GetDocIndex("^%curdoc%")$
                                      :ShowSubs
                                      ^!Set %count%=0
                                      ^!Set %choices%=""
                                      ^!If ^$StrPos("\";"^%Branch%";No)$>0 Next Else Skip_2
                                      ^!Set %choices%="_Up a level|"
                                      ^!Goto Loop
                                      ^!Set %choices%="_Up to Root|"
                                      :Loop
                                      ^!Inc %count%
                                      ^!If ^%count%>^%Subkeys0% Doit
                                      ^!Append %choices% ^%Subkeys^%count%%|
                                      ^!Goto Loop
                                      :Doit
                                      ^!SetWizardLabel ^%Branch%
                                      ^!Set %oldchosen%=^%chosen%
                                      ^!Set %chosen%=^?{(T=L;H=15)Select a key=^%choices%}
                                      ^!IfCancel Out
                                      ^!If ^%chosen%="Up a level" Up_Level
                                      ^!If ^%chosen%="Up to Root" Start
                                      ^!IfMatch "Show the \d+ Value Keys" "^%chosen%" ShowVals
                                      ^!IfMatch "No Subkey Branches Found" "^%chosen%" Skip_-5
                                      ^!IfTrue ^$IsEmpty(^%chosen%)$ Skip_-6
                                      ^!Set %Branch%="^%Branch%\^%chosen%"
                                      ^!SetClipboard ^%Branch%
                                      ^!Goto PerlSubs
                                      :Up_Level
                                      ^!Set %size%=^$StrSize("^%Branch%")$
                                      ^!Set %LastSlash%=^$StrPosRight("\";"^%Branch%";No)$
                                      ^!If ^%LastSlash%=0 Root
                                      ^!Set %Branch%=^$StrDeleteRight("^%Branch%";^$Calc(^%size%-^%LastSlash%+1)$)$
                                      ^!Goto PerlSubs
                                      :Root
                                      ^!Set %Branch%=""
                                      ^!Goto Start
                                      :ShowVals
                                      ^!Set %count%=0
                                      ^!Set %keychoices%=""
                                      :LoopVals
                                      ^!Inc %count%
                                      ^!If ^%count%>^%Valkeys0% Dovals
                                      ^!Append %keychoices% ^%Valkeys^%count%%|
                                      ^!Goto LoopVals
                                      :Dovals
                                      ^!Set %key%=^?{Select key==^%keychoices%}
                                      ^!IfCancel Out
                                      ^!IfMatch "Return to Subkey Branch Display.*" "^%key%" ShowSubs
                                      ^!IfMatch "\.Default" "^%key%" Next Else Skip_1
                                      ^!Set %key%=""
                                      ^!SetClipboard ^%Branch%:^%key%
                                      :PerlInfo
                                      ^!Menu File/New
                                      ^!InsertText ^%Branch%::^%key%
                                      ;^!RunPerl "PerlRegValScript"
                                      ^!RunPerl "AltPerlRegValScript"
                                      ^!Set %ValViaPerl%=^$StrTrim(^$GetText$)$
                                      ^!IfFileExist ^$GetAppPath$StdError.err PerlError
                                      ^!DestroyDoc
                                      ^!SetDocIndex=^$GetDocIndex("^%curdoc%")$
                                      ^!IfTrue ^$IsEmpty(^$GetRegValue("^%Branch%:^%key%")$)$ Next Else Skip_2
                                      ^!Info Notetab's ^^%caret%$GetRegValue$ function doesn't read this key!^PRegistry Value via Perl^P=^P^%ValViaPerl%
                                      ^!Goto Skip_1
                                      ^!Info Registry Value via Notetab GetRegValue (seems to work only when the value contains string or decimal value)^P =^P ^$GetRegValue("^%Branch%:^%key%")$^P===^PRegistry Value via Perl^P=^P^%ValViaPerl%
                                      ^!Goto Dovals
                                      :Out
                                      ^!Info Reminder: the last used branch and valuekey (if any) is on the clipboard.
                                      ^!ClearVariable %PassBranch%
                                      ^!Goto End
                                      :PerlError
                                      ^!Info Sorry, there was a Perl Error.
                                      ^!Open ^$GetAppPath$StdError.err


                                      H="_BrowseRegSubClip"
                                      ^!SetListDelimiter ^P
                                      ^!SetArray %Subkeys%=^%SubsandVals1%
                                      ^!SetArray %Valkeys%=^%SubsandVals2%


                                      H="_AltPerlRegScript"
                                      #;5/16/03 alternate version
                                      use strict;
                                      my $Registry;
                                      use Win32::TieRegistry 0.24 (
                                      TiedRef => \$Registry, Delimiter => "\\\\", ArrayValues => 1,
                                      SplitMultis => 1, AllowLoad => 1,
                                      qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ
                                      KEY_READ KEY_WRITE KEY_ALL_ACCESS ),
                                      );
                                      #my $Branch=$ARGV[0];
                                      my $Branch = <STDIN>;
                                      chomp $Branch;
                                      #double up slashes for use in tieregistry
                                      $Branch =~ s/\\/\\\\/g;
                                      my ($cntSubKeys,$valcount, @names, @namesunsort, @subbranches, @subbranches_unsort, $subkeycount);
                                      @namesunsort = $Registry->{"$Branch"}->ValueNames;
                                      @names = sort(@namesunsort);
                                      $valcount = @names;
                                      if ($valcount>0) {print "Show the $valcount Value Keys\n";}
                                      @subbranches_unsort = $Registry->{"$Branch"}->SubKeyNames;
                                      @subbranches = sort(@subbranches_unsort);
                                      $cntSubKeys = @subbranches;
                                      #%keyInfo= $Registry->{"$Branch"}->Information;
                                      #Alternate way to get counts
                                      #( $cntSubKeys )= $Registry->{"$Branch"}->Information( "CntSubKeys" );
                                      #print "cntSubKeys is $cntSubKeys\n";
                                      #$savecnt = $cntSubKeys;
                                      if ($cntSubKeys == 0) {print "No Subkey Branches Found\n";}
                                      else {
                                      foreach $_(@subbranches){
                                      print;
                                      print "\n";
                                      }
                                      }
                                      if ($valcount>0) {
                                      print "XSEPX\n";
                                      print "_Return to Subkey Branch Display \($cntSubKeys\)\n";
                                      foreach $_(@names){
                                      if ($_ ne "") {print "$_\n";}
                                      else {print "\.Default\n";}
                                      }
                                      }

                                      H="_AltPerlRegValScript"
                                      #;5/16/03 alternate version
                                      use strict;
                                      my $Registry;
                                      use Win32::TieRegistry 0.24 (
                                      TiedRef => \$Registry, Delimiter => "\\\\", ArrayValues => 1,
                                      SplitMultis => 1, AllowLoad => 1,
                                      qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ
                                      KEY_READ KEY_WRITE KEY_ALL_ACCESS ),
                                      );
                                      my ($valueString, $valname, $valuetype, $Branch,);
                                      #my $Branch=$ARGV[0];
                                      #my $Branch = <STDIN>;
                                      #chomp $Branch;
                                      #double up slashes for use in tieregistry
                                      while (<STDIN>) {
                                      chomp; # avoid \n on last field
                                      ($Branch, $valname) = split(/::/);
                                      }
                                      $Branch =~ s/\\/\\\\/g;
                                      ($valueString,$valuetype) = $Registry->{"$Branch"}->GetValue("$valname");
                                      if (($valuetype =~ /MULTI/) or ($valuetype == 7)) {print "Data type\: ", $valuetype, "\nValue\: ", @$valueString;}
                                      else {print "Data type\: ", $valuetype, "\nValue\: ", $valueString;}
                                      #end of script
                                    Your message has been successfully submitted and would be delivered to recipients shortly.