Created
March 28, 2021 12:04
-
-
Save gco46/eae0f82c5a9ca76e012250febf1c8361 to your computer and use it in GitHub Desktop.
GDrive-context-menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 初期状態でGoogle Driveコンテキストメニューは無効 | |
setRegistry(false) | |
; エクスプローラがアクティブの時のみ有効 | |
#IfWinActive, ahk_exe explorer.exe | |
{ | |
; 左シフト押下時にレジストリ有効 | |
~LShift:: | |
setRegistry(true) | |
return | |
; 左シフトを離したときにレジストリ無効 | |
~LShift Up:: | |
setRegistry(false) | |
return | |
setRegistry(enable) { | |
prefix:="-" | |
if (enable) { | |
prefix:="" | |
} | |
; (既定)キーに対して書き込み, -{値}でコンテキストメニュー無効化 | |
; ディレクトリのコンテキストメニュー設定 | |
RegWrite, REG_SZ, HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\GDContextMenu, , %prefix%{BB02B294-8425-42E5-983F-41A1FA970CD6} | |
RegWrite, REG_SZ, HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\DriveFS 28 or later, , %prefix%{EE15C2BD-CECB-49F8-A113-CA1BFC528F5B} | |
; ファイルのコンテキストメニュー設定 | |
RegWrite, REG_SZ, HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\GDContextMenu, , %prefix%{BB02B294-8425-42E5-983F-41A1FA970CD6} | |
RegWrite, REG_SZ, HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\DriveFS 28 or later, , %prefix%{EE15C2BD-CECB-49F8-A113-CA1BFC528F5B} | |
} | |
} | |
#IfWinActive | |
; スクリプト停止時は有効化 | |
OnExit("exitFunc") | |
; Reverts back to enabling drive on exit. | |
exitFunc() { | |
setRegistry(true) | |
ExitApp | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment