Skip to content

A .NET Core Global Tool that cleans your Windows start menu using a few very simple heuristics.

Notifications You must be signed in to change notification settings

craigktreasure/StartMenuCleaner

Repository files navigation

Start Menu Cleaner

This is a .NET Core Global Tool that cleans your Windows start menu using a few very simple heuristics.

CI Build

Tool management

Build the tool

To build the tool, run the following command:

dotnet build ./StartMenuCleaner/ -c Release

The tool will be packed into a nupkg file at ./__artifacts/package/release/.

Install the tool

These instructions assume you have previously built the tool.

To install the tool, run the following command:

dotnet tool install -g StartMenuCleaner --add-source ./__artifacts/package/release/ --version <version number>

Update the tool

These instructions assume you have previously built and installed the tool.

For stable release versions, run the following command:

dotnet tool update -g StartMenuCleaner --add-source ./__artifacts/package/release/

For pre-release versions, there is currently no way to update to a pre-release version. See here for updates on this issue. For the time being, you need to uninstall the previous version of the tool and then install the tool again.

Uninstall the tool

These instructions assume you have previously built and installed the tool.

To uninstall the tool, run the following command:

dotnet tool uninstall -g StartMenuCleaner

Running the tool

> Clean-StartMenu --help
StartMenuCleaner 2.0.0
Copyright (C) 2021 Craig Treasure

  -d, --debug       Enable debug information in console.

  -s, --simulate    Simulate all file operations.

  -w, --wait        Wait before exiting the application.

  --help            Display this help screen.

  --version         Display version information.

Configuration

This tool uses .netconfig to configure files and folders you want to cleanup.

Install the dotnet-config tool by running the following:

dotnet tool install -g dotnet-config

Ignore a directory

There is a default set of folders that are ignored by default:

chrome apps
startup
maintenance
accessories
windows accessories
windows administrative tools
windows ease of access
windows powershell
windows system
accessibility
administrative tools
system tools

You can add to this list by adding a new ignore variable to the startmenucleaner section:

dotnet config --global --add startmenucleaner.ignore "My App"

This will result in a .netconfig file that looks something like:

[startmenucleaner]
  ignore = My App

The above configuration would cause the "My App" folder to be ignored and never cleaned.

Add a file for cleanup

You can add a file for explicit removal by adding the file to your .netconfig file with a remove variable set to true:

dotnet config --global --set startmenucleaner."My App Shortcut.lnk".remove true

This will result in a .netconfig file that looks something like:

[startmenucleaner "My App Shortcut.lnk"]
  remove = true

This will cause the My App Shortcut.lnk file be to removed if it exists.

Add a directory for cleanup

You can add a directory for explicit removal by adding the directory to your .netconfig file with a remove variable set to true:

dotnet config --global --set startmenucleaner."My App/".remove true

Note the / at the end of the directory name, which is used to distinguish it from a file.

This will result in a .netconfig file that looks something like:

[startmenucleaner "My App/"]
  remove = true

This will cause the entire My App directory be to removed if it exists.

Promote directory items before removal

There are often files from a folder you want to keep and move to the main programs folder before removing the folder.

You can do so by adding a promote variable with the path to the file. For example:

dotnet config --global --add startmenucleaner."My App/".promote "My App.lnk"

This will result in a .netconfig file that looks something like:

[startmenucleaner "My App/"]
  remove = true
  promote = My App.lnk

Note the different between using the --add argument used here and the --set argument used previously. The --add argument allows you to add multiple promote variables. You can add as many promote variables as you'd like.

If the file happens to be in a nested folder, you would add the subfolder to the promote value using the / directory separator:

dotnet config --global --add startmenucleaner."My App/".promote "Subfolder/My App.lnk"

This will result in a .netconfig file that looks something like:

[startmenucleaner "My App/"]
  remove = true
  promote = My App.lnk
  promote = Subfolder/My App.lnk

Show current configurations

To list all of your current configurations, you can run the following:

dotnet config --global --list

All lines starting with startmenucleaner. will be considered as the tool runs.

Scheduling the tool using Task Scheduler

  1. In Task Scheduler, select Create Task....
  2. From the General tab, give the taks a memorable name and select Run whether user is logged on or not to hide the command window.
  3. From the Triggers tab, create a new trigger to begin At log on delayed for 30 seconds for your specific user account.
  4. From the Actions tab, create a new action to run the %USERPROFILE%\.dotnet\tools\Clean-StartMenu.exe program.
  5. Configure options on the Conditions and Settings tabs to your liking.
  6. Save the task. Upon saving, you'll be asked for your password.
    1. If your password can't be accepted, it's likely that you logged in with Windows Hello and in some cases this causes issues. The solution is to log out and log back in to Windows using your username and password as opposed to Windows Hello. Repeat the steps and and enter your password to save the task.

About

A .NET Core Global Tool that cleans your Windows start menu using a few very simple heuristics.

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages