Skip to content

Instantly share code, notes, and snippets.

@ytez
Created May 24, 2022 02:56
Show Gist options
  • Save ytez/b94be91a4b941867dd88cb2ec16d7245 to your computer and use it in GitHub Desktop.
Save ytez/b94be91a4b941867dd88cb2ec16d7245 to your computer and use it in GitHub Desktop.
CMD.exe コマンド拡張機能とは [Win10]

CMD.exe コマンド拡張機能とは [Win10]

  • 一部コマンドの動作を変更する

    The command extensions involve changes and/or additions to the following
    commands:
    
        DEL or ERASE
        COLOR
        CD or CHDIR
        MD or MKDIR
        PROMPT
        PUSHD
        POPD
        SET
        SETLOCAL
        ENDLOCAL
        IF
        FOR
        CALL
        SHIFT
        GOTO
        START (also includes changes to external command invocation)
        ASSOC
        FTYPE
    
  • 既定で有効

    Command Extensions are enabled by default.
    
  • /E:OFF スイッチを指定することで無効化可能

    You may also disable extensions for a particular invocation by using the /E:OFF switch.
    
  • システムないしユーザ単位での有効/無効はレジストリで指定可能

    # DWORD値 無効=0 有効=1
    
    # システム単位
    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions
    # ユーザ単位
    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions
  • 有効/無効設定の優先順位は高い順に下記の通り

    • setlocal (enalbe|disable)extensions コマンド
    • /E スイッチ
    • レジストリ (HKCU)
    • レジストリ (HKLM)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment