[code] reset webdialog and toolbars .bat file
-
-
@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.
-
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.
-
@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. -
@gavvy said:
reg query "HKEY_CURRENT_USER\Software\Google\SketchUp7" /s|find "WebDialog"
reg delete "HKEY_CURRENT_USER\Software\Google\SketchUp7" /s /fJim, 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? -
I am at the same point as you.
-
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... -
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 )
-
@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....
-
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.
-
I wish SU would get a brand spanking new Toolbar system.
-
@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. -
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?
Advertisement