【Tips】コマンドプロンプトからエクスプローラを開く方法

Tips

explorerコマンド

コマンドプロンプトからエクスプローラを開きたい場合、explorer コマンドを利用することで任意の場所を開くことが可能です。

逆にエクスプローラからコマンドプロンプトを起動したい場合は、こちらの手順で可能です。

引数を指定しなかった場合、ホームが開かれます。カレントディレクトリ . を指定すれば現在のディレクトリを、絶対パスまたは相対パスを指定すれば任意のディレクトリを開くことができます。

# 引数を指定しないとホームを開く
$ explorer

# 引数に「.」を指定すると現在のディレクトリを開く
$ explorer .

# 絶対パスまたは相対パスを指定すると任意のディレクトリを開く
$ explorer C:\Users\xxx\workspace
$ explorer ..\workspace

参考

Options
    /n            Open a new single-pane window for the default selection. This is usually the root
                  of the drive Windows is installed on. If the window is already open, a duplicate opens.
                  デフォルトの選択用に新しい単一ペインウィンドウを開きます。
                  これは通常、Windowsがインストールされているドライブのルートです。
                  ウィンドウが既に開いている場合は、複製が開きます。

    /e            Open Windows Explorer in its default view. This is usually the users home drive.
                  Windowsエクスプローラーをデフォルトのビューで開きます。これは通常、ユーザーのホームドライブです。

  (,)/root,object Open the specified object in a window view.
                  指定されたオブジェクトをウィンドウビューで開きます。

   /select,object Open a window view with the specified folder, file or application selected.
                  指定されたフォルダー、ファイル、またはアプリケーションを選択した状態でウィンドウビューを開きます。

   /separate      Launch an explorer instance as a separate process (undocumented option).
                  エクスプローラーインスタンスを別のプロセスとして起動します (文書化されていないオプション)。

Quotation marks are required if the File/Folder object contains spaces or symbols.
オブジェクト(ファイル/フォルダー)にスペースまたは記号が含まれている場合は引用符が必要です。

SS64 > Windows CMD > Explorer.exe