Since I am repeatedly struggling with my somehow not-reliably-working config files I needed a fast solution to quickly disable/enable all kind of config files.
Windows only (similar approach will defnitely also work on linux, though)
The following will add context menu entries to the config files for enabling/disabling them. Disabling is done via adding “_disabled” to the file extension, enabling reverts it.
The renaming is based on 2 simple .bat files.
disabler.bat:
set filename=%1
set new_filename=%filename%_disabled
move %filename% %new_filename%
enabler.bat:
set filename=%1
set new_filename=%filename:~1,-10%
move %filename% "%new_filename%"
To add the context menu entries I assembled the following .reg file (adjust the path and the caption as you wish):
- the hex codes just add beautiful icons to the menu
Windows Registry Editor Version 5.00
; rules
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.rules\shell\deactivate]
@="deactivate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.rules\shell\deactivate\command]
@="\"C:\\Replace\\With\\Your\\Path\\disabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.rules\shell\deactivate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,31,00,30,00,39,00,\
00,00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.rules_disabled\shell\activate]
@="activate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.rules_disabled\shell\activate\command]
@="\"C:\\Replace\\With\\Your\\Path\\enabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.rules_disabled\shell\activate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,30,00,31,00,\
00,00
; items
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.items\shell\deactivate]
@="deactivate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.items\shell\deactivate\command]
@="\"C:\\Replace\\With\\Your\\Path\\disabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.items\shell\deactivate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,31,00,30,00,39,00,\
00,00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.items_disabled\shell\activate]
@="activate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.items_disabled\shell\activate\command]
@="\"C:\\Replace\\With\\Your\\Path\\enabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.items_disabled\shell\activate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,30,00,31,00,\
00,00
; persistence
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.persist\shell\deactivate]
@="deactivate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.persist\shell\deactivate\command]
@="\"C:\\Replace\\With\\Your\\Path\\disabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.persist\shell\deactivate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,31,00,30,00,39,00,\
00,00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.persist_disabled\shell\activate]
@="activate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.persist_disabled\shell\activate\command]
@="\"C:\\Replace\\With\\Your\\Path\\enabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.persist_disabled\shell\activate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,30,00,31,00,\
00,00
; scripts
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.script\shell\deactivate]
@="deactivate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.script\shell\deactivate\command]
@="\"C:\\Replace\\With\\Your\\Path\\disabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.script\shell\deactivate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,31,00,30,00,39,00,\
00,00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.script_disabled\shell\activate]
@="activate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.script_disabled\shell\activate\command]
@="\"C:\\Replace\\With\\Your\\Path\\enabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.script_disabled\shell\activate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,30,00,31,00,\
00,00
; sitemaps
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.sitemap\shell\deactivate]
@="deactivate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.sitemap\shell\deactivate\command]
@="\"C:\\Replace\\With\\Your\\Path\\disabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.sitemap\shell\deactivate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,31,00,30,00,39,00,\
00,00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.sitemap_disabled\shell\activate]
@="activate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.sitemap_disabled\shell\activate\command]
@="\"C:\\Replace\\With\\Your\\Path\\enabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.sitemap_disabled\shell\activate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,30,00,31,00,\
00,00
; things
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.things\shell\deactivate]
@="deactivate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.things\shell\deactivate\command]
@="\"C:\\Replace\\With\\Your\\Path\\disabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.things\shell\deactivate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,31,00,30,00,39,00,\
00,00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.things_disabled\shell\activate]
@="activate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.things_disabled\shell\activate\command]
@="\"C:\\Replace\\With\\Your\\Path\\enabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.things_disabled\shell\activate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,30,00,31,00,\
00,00
; transforms
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.map\shell\deactivate]
@="deactivate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.map\shell\deactivate\command]
@="\"C:\\Replace\\With\\Your\\Path\\disabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.map\shell\deactivate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,31,00,30,00,39,00,\
00,00
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.map_disabled\shell\activate]
@="activate"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.map_disabled\shell\activate\command]
@="\"C:\\Replace\\With\\Your\\Path\\enabler.bat\" \"%1\""
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.map_disabled\shell\activate]
"Icon"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,\
5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,65,\
00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,33,00,30,00,31,00,\
00,00