Add a macro that executes this command, then add a macro to the toolbar.
This works because the command line command is displayed in the Macros menu of the Customize Commands dialog box.
More details
Add a macro that does the following:
Sub _ReSharper_SilentCleanupCode() DTE.ExecuteCommand("ReSharper_SilentCleanupCode") End Sub
Place this macro in the module that appears in the setting ..Commands..AddCommand..Categories..Macros, for example Samples or MyMacros.RecordingModule, but not MyMacros.Module1 (by default when using the IDE macro).
Go to Tools..Customize..Command and select the Toolbar you want.
Now Add Command... and select the Macros category.
Select the Macros.Samples._ReSharper_SilentCleanupCode macro.
Click Modify Selection and change the name to #-) or to any other text that makes you think that ReSharper Silent Code Cleanup will not be too long for your toolbar .:-)
I tried this with Visual Studio 2010 and ReSharper 7.1.2.
Edit
Visual Commander is apparently the way to get this on VS2012 - see comments below for more.
source share