1. Open the registry
Go to Computer \ HKEY_CLASSES_ROOT \ Directory \ Background \ shell \
2. New item Cmd Here (free name)
New in Cmd Here
icon is an icon.
3. Under Cmd Here, create a new command (must be command)
Change the default value of command to "C: \ Windows \ System32 \ cmd.exe" "--working-dir" "% v."
The same applies to msys2, but the command parameter of msys2 is:
C:\msys64\msys2_shell.cmd -mingw64 -here