2010-10-31 05:54:15 +0000 2010-10-31 05:54:15 +0000
116
116
Advertisement

現在のフォルダのコマンドプロンプトをキーボードショートカットで開くにはどうしたらいいですか

Advertisement

Windows 7で現在のフォルダのコマンドプロンプトをキーボードショートカットで開くにはどうしたらいいですか これを実装する方法はありますか Autohotkeyでもできると思うのですが、方法がわかりません。

Advertisement
Advertisement

回答 (11)

122
122
122
2010-10-31 06:53:07 +0000

このキーボードショートカットを使用します。Shift + Menu, W, Enter

  1. Shift + メニュー (代わりに、Shift + F10)、(現在のフォルダで拡張右クリックメニューを開きます)

  2. W(「ここにコマンドウィンドウを開く」を選択)、

  3. Enter (選択を有効にします。"新規 “もWで選択可能なので必要です)

メニューキーはマイクロソフトが導入した特別なキーを指し、通常は右Winキーの右にあります。

このショートカットはサードパーティソフトウェアなしでWindows(7)のデフォルトインストールで利用可能です。


AHKの方法。あなたはちょうど勝利 + C (またはあなたがそれをとして定義したいと思うものは何でも)を押す必要があります:

SetTitleMatchMode RegEx
return

; Stuff to do when Windows Explorer is open
;
#IfWinActive ahk_class ExploreWClass|CabinetWClass

    ; create new text file
    ;
    #t::Send !fwt

    ; open 'cmd' in the current directory
    ;
    #c::
        OpenCmdInCurrent()
    return
#IfWinActive

; Opens the command shell 'cmd' in the directory browsed in Explorer.
; Note: expecting to be run when the active window is Explorer.
;
OpenCmdInCurrent()
{
    ; This is required to get the full path of the file from the address bar
    WinGetText, full_path, A

    ; Split on newline (`n)
    StringSplit, word_array, full_path, `n

    ; Find and take the element from the array that contains address
    Loop, %word_array0%
    {
        IfInString, word_array%A_Index%, Address
        {
            full_path := word_array%A_Index%
            break
        }
    }  

    ; strip to bare address
    full_path := RegExReplace(full_path, "^Address: ", "")

    ; Just in case - remove all carriage returns (`r)
    StringReplace, full_path, full_path, `r, , all

    IfInString full_path, \
    {
        Run, cmd /K cd /D "%full_path%"
    }
    else
    {
        Run, cmd /K cd /D "C:\ "
    }
}

ボーナスとして、上のスクリプトはまたこのショートカットが付いている新しいテキストファイルを作成します。Win + T

Credit to. Eli Bendersky ](https://stackoverflow.com/questions/98597/best-autohotkey-macros/100648#100648)

120
120
120
2011-05-27 13:53:05 +0000

Alt+Dを押して、cmdと入力してEnterキーを押します。詳細はブログ記事こちらを参照してください。

42
Advertisement
42
42
2010-10-31 06:25:07 +0000
Advertisement

Windows7で同様のことをするネイティブな方法は、シフトを押しながら右マウスを “コマンドプロンプト "したいフォルダの上に押して、新しいメニュー項目がコンテキストメニューに表示され、まさにそれを提供しています。”

もし純粋なキーボード操作をしたい場合は、次のようにしなければなりません:

  • open regedit
  • go to HKEY_CLASSES_ROOT\Directory\shell\cmd and rename to Extended key to Extended_save
  • go to HKEY_CLASSES_ROOT\Drive\shell\cmd and rename to Extended key toExtended_save`

this adds the “open command window here” entry to the context menu permanently. you can trigger this entry by pressing:

  • alt
  • let go, context menu opens
  • press the “underscored” character of the “open command window here” entry or go down with your cursor keys and hit enter

the name of the menu entry is labled according to the language of your OS.

an alternative route is to do this:

  • open the folder you want in the command prompt via the explorer
  • f4
  • ctrla
  • ctrlc
  • winr
  • cmd /k cd ctrlventer

which grabs the current path from the address bar of explorer and executes cmd /k cd PATH. autohotkeysでも同じことができますが、私はautohotkeysを知りません。

9
9
9
2016-07-31 04:20:11 +0000

from how-to-open-cmd-in-current-folder-by-shortcut-windows-10

Windows 8/10をお使いの場合、より速く、よりオリジナルな方法があります: Alt + F, P

他のプログラムの助けを借りずに、3つのキーを押して2回入力するだけです。

3
Advertisement
3
3
2018-02-08 03:24:22 +0000
Advertisement

最新の Windows 10 アップデートでは、Leftium の回答の Shift + Menu, W メソッドは動作しなくなりました。しかし、ちょっとした修正で、もう少しキーストロークが必要ですが、回避策を提示することができます。

問題は、Command Prompt が Extended Right-Click Menu で利用できなくなったことです。その代わりに Windows Powershell があります。

Shift + Menu, S でターゲットフォルダ内の Windows Powershell を開きます。Windows Powershellに入ったら、cmdと入力してEnterキーを押してください。しかし、それはあなたがディレクトリ間で移動を続けるためにWindowsエクスプローラのウィンドウに戻るつもりがない場合にのみ、エレガントです。残念なことに、この方法ではWindowsエクスプローラのカーソルがメインウィンドウから離れてしまい、矢印キーを使ってフォルダを移動できる場所に戻すには、Tabキーを何回も押す必要があります。

Windows Powershell はほとんどの点で Command Prompt と同じように動作しますが、私は Windows Powershell が (javadocs を生成しているときに) 私の @tags を誤って読み違えてしまい、希望する結果が得られないというケースに少なくとも 1 回は遭遇しました。Windows Powershell 内で cmd と入力してから Enter を押すと、代わりにコマンドプロンプトを使うことができ、このような問題を解決することができます。

2
2
2
2016-06-03 02:43:11 +0000

最も簡単な方法は、ウィンドウズエクスプローラーのアドレスバーに移動してcmdを入力し、その場所からすぐにコマンドプロンプトを開くことです。

1
Advertisement
1
1
2018-12-28 11:59:57 +0000
Advertisement

選択問題のものよりも簡単なAHKスクリプト

#c::cmdHere()

cmdHere() {
    If WinActive("ahk_class CabinetWClass") || WinActive("ahk_class ExploreWClass") {
        WinHWND := WinActive()
        For win in ComObjCreate("Shell.Application").Windows
            If (win.HWND = WinHWND) {
                dir := SubStr(win.LocationURL, 9) ; remove "file:///"
                dir := RegExReplace(dir, "%20", " ")
                Break
            }
    }
    Run, cmd, % dir ? dir : A_Desktop
}

source from here : https://autohotkey.com/boards/viewtopic.php?t=5796

1
1
1
2011-10-15 16:35:43 +0000

AutoHotKeyスクリプトを使用してコマンドプロンプトを開く @Ashwinの方法

Win Pを使用してPowershellコンソールを開く

#P::
{
    Send !D
    Send powershell
    Send {Enter}    
    return
}

Win Cを使用してコマンドプロンプトを開く

#C::
{
    Send !D
    Send CMD
    Send {Enter}    
    return
}
0
Advertisement
0
0
2014-06-27 14:16:11 +0000
Advertisement

もしあなたがドイツ語版のWindowsを使用している場合、あなたはこれを行うことができます:

Alt+D,Eを押してください

Alt+Dはcmd以外にもいくつかの他のものを選択することができるメニューを開きます

0
0
0
2020-02-23 19:48:34 +0000

PowerShell OpenHere モジュール の使い方は?

PowerShell を昇格パーミッションで実行してタイプ: Install-Module OpenHere Set-OpenHereShortcut -ShortcutType:CMD

免責事項:

私はこのモジュールの開発者です。

-1
-1
-1
2018-05-14 14:52:16 +0000

AHKの場合は、以下のようなバインディングになっています。

Advertisement

関連する質問

3
19
10
28
1
Advertisement
Advertisement