[code] reset webdialog and toolbars .bat file

[code] reset webdialog and toolbars .bat file

Postby Jim » Thu Nov 05, 2009 12:41 am

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.
0
Hi

Jim 
Global Moderator
 

Re: .bat file help

Postby gavvy » Thu Nov 05, 2009 3:30 am

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

gavvy 
PluginStore Author
PluginStore Author
 

Re: .bat file help

Postby gavvy » Thu Nov 05, 2009 3:38 am

0

gavvy 
PluginStore Author
PluginStore Author
 

Re: .bat file help

Postby thomthom » Thu Nov 05, 2009 8:36 am

Jim wrote: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.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: .bat file help

Postby Jim » Thu Nov 05, 2009 2:16 pm

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.
0
Hi

Jim 
Global Moderator
 

Re: .bat file help

Postby thomthom » Thu Nov 05, 2009 2:29 pm

Jim wrote: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 wrote: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.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: .bat file help

Postby thomthom » Thu Nov 05, 2009 2:31 pm

gavvy wrote: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?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: .bat file help

Postby Jim » Thu Nov 05, 2009 2:35 pm

I am at the same point as you.
0
Hi

Jim 
Global Moderator
 

Re: .bat file help

Postby thomthom » Thu Nov 05, 2009 2:45 pm

Looking at http://technet.microsoft.com/en-us/libr ... 90984.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...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: .bat file help

Postby Jim » Thu Nov 05, 2009 2:55 pm

I came up with this:

Code: Select all
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
)
0
Hi

Jim 
Global Moderator
 

Re: .bat file help

Postby thomthom » Mon Jan 03, 2011 3:08 pm

Jim wrote:I came up with this:

Code: Select all
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!!! :shock: 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....
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [code] reset webdialog and toolbars .bat file

Postby Jim » Mon Jan 03, 2011 3:20 pm

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.
0
Hi

Jim 
Global Moderator
 

Re: [code] reset webdialog and toolbars .bat file

Postby thomthom » Mon Jan 03, 2011 3:30 pm

I wish SU would get a brand spanking new Toolbar system. :cry:
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: .bat file help

Postby mumbus » Wed Oct 12, 2016 8:04 pm

thomthom wrote:
Jim wrote:I came up with this:

Code: Select all
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!!! :shock: 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.
0

mumbus 
 

Re: [code] reset webdialog and toolbars .bat file

Postby Jim » Wed Oct 12, 2016 10:29 pm

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?
1
Hi

Jim 
Global Moderator
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: Bing [Bot], P53ud0 and 2 guests

Visit our sponsors: