• Login
sketchucation logo sketchucation
  • Login
πŸ€‘ 30% Off | Artisan 2 on sale until April 30th Buy Now

[code] reset webdialog and toolbars .bat file

Scheduled Pinned Locked Moved Developers' Forum
15 Posts 4 Posters 3.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    Jim
    last edited by 4 Nov 2009, 23:41

    I want to be able to use a batch file to remove all the WebDialogs from the SketchUp registry. Is there a way to use a regular expression do create a .reg file to remove anything that begins with WebDialog_ ?

    I guess I could pull the entire Sketchup7 tree from the .bat, and parse it using Ruby. I'll try that.

    Hi

    1 Reply Last reply Reply Quote 0
    • G Offline
      gavvy
      last edited by 5 Nov 2009, 02:30

      reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" /s|find "WebDialog"
      reg delete "HKEY_CURRENT_USER\Software\Google\SketchUp7" /s /f

      1 Reply Last reply Reply Quote 0
      • G Offline
        gavvy
        last edited by 5 Nov 2009, 02:38

        πŸ˜„ http://www.ruby-doc.org/stdlib/libdoc/Win32API/rdoc/classes/Win32/Registry.html

        1 Reply Last reply Reply Quote 0
        • T Offline
          thomthom
          last edited by 5 Nov 2009, 07:36

          @jim said:

          I want to be able to use a batch file to remove all the WebDialogs from the SketchUp registry. Is there a way to use a regular expression do create a .reg file to remove anything that begins with WebDialog_ ?

          I guess I could pull the entire Sketchup7 tree from the .bat, and parse it using Ruby. I'll try that.

          That's interesting you should mention this. I was thinking that yesterday when I was looking at the registry settings for Sketchup and I saw all the old junk entries for old Webdialogs. I also noticed that on a couple of systems I had, there was 100-200 entries for the toolbar. "Purge Registry" I was thinking then.

          Thomas Thomassen β€” SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • J Offline
            Jim
            last edited by 5 Nov 2009, 13:16

            Toolbars were easier since there is an entry in the Summary that tells yo how many Toolbars there are in the registry. And since the toolbars are numbered in order, it's easy to reconstruct their key and remove them.

            There isn't any summary information for WebDialogs, so you need to find them by name.

            The other thing i do is sometimes is completely remove the Sketchu7 section, but sometimes I am only interested in resetting toolbars and dialogs in order to test the "first opening" experience.

            Hi

            1 Reply Last reply Reply Quote 0
            • T Offline
              thomthom
              last edited by 5 Nov 2009, 13:29

              @jim said:

              Toolbars were easier since there is an entry in the Summary that tells yo how many Toolbars there are in the registry. And since the toolbars are numbered in order, it's easy to reconstruct their key and remove them.
              I found that on one of my systems the count and number of entries didn't match. I had more entries than the count.

              @jim said:

              There isn't any summary information for WebDialogs, so you need to find them by name.

              The other thing i do is sometimes is completely remove the Sketchu7 section, but sometimes I am only interested in resetting toolbars and dialogs in order to test the "first opening" experience.

              Can't the values be enumerated?
              Not sure how it works with .bat files, but with the Win32::Registry you can iterate over a registry path's keys and values.

              Thomas Thomassen β€” SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund

              1 Reply Last reply Reply Quote 0
              • T Offline
                thomthom
                last edited by 5 Nov 2009, 13:31

                @gavvy said:

                reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" /s|find "WebDialog"
                reg delete "HKEY_CURRENT_USER\Software\Google\SketchUp7" /s /f

                Jim, did this work?

                When I run reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" /s|find "WebDialog" in a command prompt it does list all the entries, but I've yet to try the delete command. I don't understand how it would know what to delete. does it reference to the previous query command?

                Thomas Thomassen β€” SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • J Offline
                  Jim
                  last edited by 5 Nov 2009, 13:35

                  I am at the same point as you.

                  Hi

                  1 Reply Last reply Reply Quote 0
                  • T Offline
                    thomthom
                    last edited by 5 Nov 2009, 13:45

                    Looking at http://technet.microsoft.com/en-us/library/bb490984.aspx

                    reg delete KeyName [{/v EntryName|/ve|/va}] [/f]
                    I see no /s argument. And /f seem to suppress all prompts. I wonder if that command nukes the whole Sketchup section...

                    Thomas Thomassen β€” SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • J Offline
                      Jim
                      last edited by 5 Nov 2009, 13:55

                      I came up with this:

                      
                      reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" | find "WebDialog_" > reg_keys.txt
                      reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" | find "ToolbarsUser" >> reg_keys.txt
                      
                      for /f %%k in (reg_keys.txt) do (
                          reg delete %%k /f
                      )
                      
                      

                      Hi

                      1 Reply Last reply Reply Quote 0
                      • T Offline
                        thomthom
                        last edited by 3 Jan 2011, 14:08

                        @jim said:

                        I came up with this:

                        
                        > reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" | find "WebDialog_" > reg_keys.txt
                        > reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" | find "ToolbarsUser" >> reg_keys.txt
                        > 
                        > for /f %%k in (reg_keys.txt) do (
                        >     reg delete %%k /f
                        > )
                        > 
                        

                        This snippet just saved my day.
                        I'd been working on a plugin where I ran into errors in the code that created toolbars - and that cause Toolbar Shuffle. Eventually I noticed that the SU window became very sluggish - when opening, resizing, focusing etc.

                        I'd experienced this before - had to reinstall SU.

                        This time I checked the registry .... 1600+ ToolbarsUser items!!! 😲 Pluss double in the backups which SU8 makes.

                        Running that snippet of yours cleaned up the system. SU is as snappy as anything again.

                        Another point scored for Toolbar Shuffle....

                        Thomas Thomassen β€” SketchUp Monkey & Coding addict
                        List of my plugins and link to the CookieWare fund

                        1 Reply Last reply Reply Quote 0
                        • J Offline
                          Jim
                          last edited by 3 Jan 2011, 14:20

                          It's really screwed up. It seems if you turn off a plugin via the Extensions dialog, the next time it is enabled, any Toolbars are treated as new and new Registry entries created.

                          It's sort of killing my idea for a pre-launch extensions manager because toolbars are reset whenever an Extensions is re-enabled.

                          Hi

                          1 Reply Last reply Reply Quote 0
                          • T Offline
                            thomthom
                            last edited by 3 Jan 2011, 14:30

                            I wish SU would get a brand spanking new Toolbar system. 😒

                            Thomas Thomassen β€” SketchUp Monkey & Coding addict
                            List of my plugins and link to the CookieWare fund

                            1 Reply Last reply Reply Quote 0
                            • M Offline
                              mumbus
                              last edited by 12 Oct 2016, 19:04

                              @thomthom said:

                              @jim said:

                              I came up with this:

                              
                              > > reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" | find "WebDialog_" > reg_keys.txt
                              > > reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" | find "ToolbarsUser" >> reg_keys.txt
                              > > 
                              > > for /f %%k in (reg_keys.txt) do (
                              > >     reg delete %%k /f
                              > > )
                              > > 
                              

                              This snippet just saved my day.
                              I'd been working on a plugin where I ran into errors in the code that created toolbars - and that cause Toolbar Shuffle. Eventually I noticed that the SU window became very sluggish - when opening, resizing, focusing etc.

                              I'd experienced this before - had to reinstall SU.

                              This time I checked the registry .... 1600+ ToolbarsUser items!!! 😲 Pluss double in the backups which SU8 makes.

                              Running that snippet of yours cleaned up the system. SU is as snappy as anything again.

                              Another point scored for Toolbar Shuffle....

                              Dumb question. Does this get entered at the CMD prompt? I get errors.
                              %%k was unexpected at this time
                              Error: Invalid key name.

                              1 Reply Last reply Reply Quote 0
                              • J Offline
                                Jim
                                last edited by 12 Oct 2016, 21:29

                                Unless you're still using SketchUp 7 or 8, you don't need this; and even if your are, you still probably don't need it.

                                What problem do you wish to solve by running this code?

                                Hi

                                1 Reply Last reply Reply Quote 0
                                • 1 / 1
                                • First post
                                  Last post
                                Buy SketchPlus
                                Buy SUbD
                                Buy WrapR
                                Buy eBook
                                Buy Modelur
                                Buy Vertex Tools
                                Buy SketchCuisine
                                Buy FormFonts

                                Advertisement