Skip to content

Instantly share code, notes, and snippets.

@Muetze42
Last active November 10, 2021 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Muetze42/5dcde875627ba1bbec57d027957feb7f to your computer and use it in GitHub Desktop.
Save Muetze42/5dcde875627ba1bbec57d027957feb7f to your computer and use it in GitHub Desktop.
Tested with Windows 11, but should work with older Windows Versions too (Example with Umlauts for Mp3tag)
goto comment
/*
|--------------------------------------------------------------------------
| Instruction
|--------------------------------------------------------------------------
|
| * With Notepadd++
| * [For specialchars and Umlauts] `Encoding` => `Convert to ANSI`
| * [For specialchars and Umlauts] `Language` => `M` => `MS-Dos Style`
| * Set `FileLocation`, `ItemText and `ItemNamespace`
| * Save file as *.bat
| * Run file as Administrator
|
*/
:comment
@echo off
SET "FileLocation=C:\Users\norma\OneDrive\Dokumente\Sync\Mp3tag\Mp3tag.exe"
SET "ItemText=In Mp3tag öffnen"
SET "ItemNamespace=Mp3tag"
echo Adding file entries
@reg add "HKEY_CLASSES_ROOT\*\shell\%ItemNamespace%" /t REG_SZ /v "" /d "%ItemText%" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\%ItemNamespace%" /t REG_EXPAND_SZ /v "Icon" /d "%FileLocation%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\%ItemNamespace%\command" /t REG_SZ /v "" /d "%FileLocation% \"%%1\"" /f
echo Adding within a folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\%ItemNamespace%" /t REG_SZ /v "" /d "%ItemText%" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\%ItemNamespace%" /t REG_EXPAND_SZ /v "Icon" /d "%FileLocation%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\%ItemNamespace%\command" /t REG_SZ /v "" /d "%FileLocation% \"%%V\"" /f
echo Adding folder entries
@reg add "HKEY_CLASSES_ROOT\Directory\shell\%ItemNamespace%" /t REG_SZ /v "" /d "%ItemText%" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\%ItemNamespace%" /t REG_EXPAND_SZ /v "Icon" /d "%FileLocation%,0" /f
@reg add "HKEY_CLASSES_ROOT\Directory\shell\%ItemNamespace%\command" /t REG_SZ /v "" /d "%FileLocation% \"%%1\"" /f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment