How can I open a command prompt in current folder with a keyboard shortcut?












111















How can I open a command prompt in current folder with a keyboard shortcut in Windows 7?

Is there any way to implement this?

I think Autohotkey could do this, but don't know how.










share|improve this question




















  • 1





    Related: Open command prompt window without holding shift

    – slhck
    Feb 25 '13 at 10:19






  • 3





    Protip: Shift right-click > Open Command Window Here

    – Derek 朕會功夫
    Jul 2 '15 at 3:10
















111















How can I open a command prompt in current folder with a keyboard shortcut in Windows 7?

Is there any way to implement this?

I think Autohotkey could do this, but don't know how.










share|improve this question




















  • 1





    Related: Open command prompt window without holding shift

    – slhck
    Feb 25 '13 at 10:19






  • 3





    Protip: Shift right-click > Open Command Window Here

    – Derek 朕會功夫
    Jul 2 '15 at 3:10














111












111








111


50






How can I open a command prompt in current folder with a keyboard shortcut in Windows 7?

Is there any way to implement this?

I think Autohotkey could do this, but don't know how.










share|improve this question
















How can I open a command prompt in current folder with a keyboard shortcut in Windows 7?

Is there any way to implement this?

I think Autohotkey could do this, but don't know how.







windows command-line keyboard-shortcuts autohotkey






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 3 '14 at 21:19









Nifle

28k2393128




28k2393128










asked Oct 31 '10 at 5:54









GemiliGemili

658265




658265








  • 1





    Related: Open command prompt window without holding shift

    – slhck
    Feb 25 '13 at 10:19






  • 3





    Protip: Shift right-click > Open Command Window Here

    – Derek 朕會功夫
    Jul 2 '15 at 3:10














  • 1





    Related: Open command prompt window without holding shift

    – slhck
    Feb 25 '13 at 10:19






  • 3





    Protip: Shift right-click > Open Command Window Here

    – Derek 朕會功夫
    Jul 2 '15 at 3:10








1




1





Related: Open command prompt window without holding shift

– slhck
Feb 25 '13 at 10:19





Related: Open command prompt window without holding shift

– slhck
Feb 25 '13 at 10:19




3




3





Protip: Shift right-click > Open Command Window Here

– Derek 朕會功夫
Jul 2 '15 at 3:10





Protip: Shift right-click > Open Command Window Here

– Derek 朕會功夫
Jul 2 '15 at 3:10










10 Answers
10






active

oldest

votes


















117














Use this keyboard shortcut: Shift + Menu, W, Enter




  1. Shift + Menu (alternatively, Shift + F10), (opens extended right-click menu in current folder)


  2. W (selects "Open Command Window Here"),



  3. Enter (activates selection; required since "New" is also selectable with W)


The Menu key refers to the special key introduced by Microsoft, usually to the right of the right Win key.



This shortcut is available on a default installation of Windows (7) without any 3rd party software.





The AHK way. You just need to press Win + C (or whatever you want to define it as.):



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: "
}
}


As a bonus, the script above also creates a new text file with this shortcut: Win + T



Credit to: Eli Bendersky






share|improve this answer





















  • 1





    ah, shift-menu is nice.

    – akira
    Oct 31 '10 at 11:50













  • How do you use this script exactly?

    – Jonathan
    Feb 1 '11 at 7:12











  • @Jonathan: Install Auto-HotKey (autohotkey.com). Copy the script contents to the AutoHotkey.ahk file. (probably in %USERPROFILE%documents) Restart Auto-Hotkey.

    – Leftium
    Feb 1 '11 at 8:17













  • This was the only working solution out of all the AutoHotkey snippets I found on the web. Thanks a lot!

    – Lucas
    Oct 23 '14 at 10:35











  • Does not work for me.

    – boleslaw.smialy
    Jul 29 '15 at 12:20



















106














Press Alt+D, type cmd and press Enter. For more details see blog post here.






share|improve this answer


























  • nice! the other option doesn't seem to show the "open command window here" option unless you right-click on a folder - inside the folder, it doesn't show

    – divillysausages
    Feb 26 '13 at 21:55











  • This opens a cmd window, but it does not open one at the current directory. The same thing can be accomplished with win+r, cmd

    – Ed Orsi
    Jul 2 '14 at 19:02











  • Note - You do not need to press Alt+d for this to work. All I had to do in Windows 7 was type cmd into the path of windows explorer and press enter. Alt+d just automatically selects the current path.

    – MiniRagnarok
    Jul 30 '15 at 12:50






  • 2





    Ctrl+L is an alternative.

    – pkr298
    Sep 29 '15 at 14:56











  • Beautiful! Simple

    – Uzumaki Naruto
    Mar 24 '17 at 6:52



















42














the native way to do something similar in windows7 is to hold down shift while pressing the right mouse onto the folder you want to "command prompt" to and a new menu item will appear in your context menu offering you exactly that: "open command prompt here".



alt text



if you want pure keyboard action then you have to do this:




  • open regedit

  • go to HKEY_CLASSES_ROOTDirectoryshellcmd and rename the Extended key to Extended_save

  • go to HKEY_CLASSES_ROOTDriveshellcmd and rename the 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. with autohotkeys you can do the same, but i do not know autohotkeys.






share|improve this answer


























  • Thanks! I knew the first way, even it is simple enough, i still like the way of using keyboard shortcuts. And the second way seems a little complicated

    – Gemili
    Oct 31 '10 at 6:50











  • Love it, +1 10 char min

    – jcollum
    Apr 7 '11 at 15:34



















7














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



If you are using Windows 8/10, there is a faster and original way :



Alt + F, P



Just three key and type twice , without help of another program.






share|improve this answer

































    1














    AutoHotKey script to open command prompt using @Ashwin's method



    Open Powershell console using Win P



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


    Open command prompt using Win C



    #C::
    {
    Send !D
    Send CMD
    Send {Enter}
    return
    }





    share|improve this answer

































      1














      Easiest way is to goto the windows explorer address bar and type in cmd, it wil lopen the command prompt immediately from that location.






      share|improve this answer
























      • Please read the question again carefully. Your answer does not answer the original question, which asks for a keyboard shortcut.

        – DavidPostill
        Jun 3 '16 at 9:58



















      1














      As of the latest Windows 10 update, Leftium's answer's Shift + Menu, W method no longer works. However, a small modification can present a workaround, albeit with a few more keystrokes.



      The problem is that Command Prompt is no longer available in the Extended Right-Click Menu. Instead, you now have Windows Powershell.



      Shift + Menu, S opens up Windows Powershell in the target folder. Once in Windows Powershell, type cmd then press Enter.



      This will give you access to Command Prompt within Windows Powershell.



      P.S.



      Ashwin Nanjappa's method of Ctrl + L, type cmd then press Enter works. However, it is elegant only if you do not intend to return to the Windows Explorer window to continue navigating among directories. Unfortunately the method brings your cursor in Windows Explorer away from the main window and requires a number of Tab keystrokes to get it back to where you can navigate folders using the arrow keys. This can be frustrating as there is limited visual confirmation when you are pressing those Tab keystrokes.



      Whereas Windows Powershell does work in most ways identically to Command Prompt, I have encountered at least one case in which Windows Powershell was erroneously misreading my @tags (when I was generating javadocs) and not producing the desired result. By typing cmd then Enter within Windows Powershell, you can use Command Prompt instead which overcomes such issues.






      share|improve this answer

































        0














        If you are using a german languaged Windows version you can do this:



        Press Alt+D,E



        Alt+D opens a menu where you can select a few other things besides the cmd






        share|improve this answer


























        • Alt+D select the Address Bar, not a menu

          – Canadian Luke
          Jul 29 '15 at 18:03











        • Seems to only work on German languaged Windows versions

          – foobarbaz
          Jul 29 '15 at 22:55











        • Edit your answer then I can remove the down vote

          – Canadian Luke
          Jul 29 '15 at 22:58



















        0














        For AHK, following is my binding:



        #c::
        Run, C:Windowssystem32cmd.exe
        return


        This does not open current folder, but it is handy.






        share|improve this answer































          0














          A simpler AHK script than the one in the selected question



          #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






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f205359%2fhow-can-i-open-a-command-prompt-in-current-folder-with-a-keyboard-shortcut%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            10 Answers
            10






            active

            oldest

            votes








            10 Answers
            10






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            117














            Use this keyboard shortcut: Shift + Menu, W, Enter




            1. Shift + Menu (alternatively, Shift + F10), (opens extended right-click menu in current folder)


            2. W (selects "Open Command Window Here"),



            3. Enter (activates selection; required since "New" is also selectable with W)


            The Menu key refers to the special key introduced by Microsoft, usually to the right of the right Win key.



            This shortcut is available on a default installation of Windows (7) without any 3rd party software.





            The AHK way. You just need to press Win + C (or whatever you want to define it as.):



            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: "
            }
            }


            As a bonus, the script above also creates a new text file with this shortcut: Win + T



            Credit to: Eli Bendersky






            share|improve this answer





















            • 1





              ah, shift-menu is nice.

              – akira
              Oct 31 '10 at 11:50













            • How do you use this script exactly?

              – Jonathan
              Feb 1 '11 at 7:12











            • @Jonathan: Install Auto-HotKey (autohotkey.com). Copy the script contents to the AutoHotkey.ahk file. (probably in %USERPROFILE%documents) Restart Auto-Hotkey.

              – Leftium
              Feb 1 '11 at 8:17













            • This was the only working solution out of all the AutoHotkey snippets I found on the web. Thanks a lot!

              – Lucas
              Oct 23 '14 at 10:35











            • Does not work for me.

              – boleslaw.smialy
              Jul 29 '15 at 12:20
















            117














            Use this keyboard shortcut: Shift + Menu, W, Enter




            1. Shift + Menu (alternatively, Shift + F10), (opens extended right-click menu in current folder)


            2. W (selects "Open Command Window Here"),



            3. Enter (activates selection; required since "New" is also selectable with W)


            The Menu key refers to the special key introduced by Microsoft, usually to the right of the right Win key.



            This shortcut is available on a default installation of Windows (7) without any 3rd party software.





            The AHK way. You just need to press Win + C (or whatever you want to define it as.):



            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: "
            }
            }


            As a bonus, the script above also creates a new text file with this shortcut: Win + T



            Credit to: Eli Bendersky






            share|improve this answer





















            • 1





              ah, shift-menu is nice.

              – akira
              Oct 31 '10 at 11:50













            • How do you use this script exactly?

              – Jonathan
              Feb 1 '11 at 7:12











            • @Jonathan: Install Auto-HotKey (autohotkey.com). Copy the script contents to the AutoHotkey.ahk file. (probably in %USERPROFILE%documents) Restart Auto-Hotkey.

              – Leftium
              Feb 1 '11 at 8:17













            • This was the only working solution out of all the AutoHotkey snippets I found on the web. Thanks a lot!

              – Lucas
              Oct 23 '14 at 10:35











            • Does not work for me.

              – boleslaw.smialy
              Jul 29 '15 at 12:20














            117












            117








            117







            Use this keyboard shortcut: Shift + Menu, W, Enter




            1. Shift + Menu (alternatively, Shift + F10), (opens extended right-click menu in current folder)


            2. W (selects "Open Command Window Here"),



            3. Enter (activates selection; required since "New" is also selectable with W)


            The Menu key refers to the special key introduced by Microsoft, usually to the right of the right Win key.



            This shortcut is available on a default installation of Windows (7) without any 3rd party software.





            The AHK way. You just need to press Win + C (or whatever you want to define it as.):



            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: "
            }
            }


            As a bonus, the script above also creates a new text file with this shortcut: Win + T



            Credit to: Eli Bendersky






            share|improve this answer















            Use this keyboard shortcut: Shift + Menu, W, Enter




            1. Shift + Menu (alternatively, Shift + F10), (opens extended right-click menu in current folder)


            2. W (selects "Open Command Window Here"),



            3. Enter (activates selection; required since "New" is also selectable with W)


            The Menu key refers to the special key introduced by Microsoft, usually to the right of the right Win key.



            This shortcut is available on a default installation of Windows (7) without any 3rd party software.





            The AHK way. You just need to press Win + C (or whatever you want to define it as.):



            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: "
            }
            }


            As a bonus, the script above also creates a new text file with this shortcut: Win + T



            Credit to: Eli Bendersky







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 23 '17 at 12:41









            Community

            1




            1










            answered Oct 31 '10 at 6:53









            LeftiumLeftium

            6,73794271




            6,73794271








            • 1





              ah, shift-menu is nice.

              – akira
              Oct 31 '10 at 11:50













            • How do you use this script exactly?

              – Jonathan
              Feb 1 '11 at 7:12











            • @Jonathan: Install Auto-HotKey (autohotkey.com). Copy the script contents to the AutoHotkey.ahk file. (probably in %USERPROFILE%documents) Restart Auto-Hotkey.

              – Leftium
              Feb 1 '11 at 8:17













            • This was the only working solution out of all the AutoHotkey snippets I found on the web. Thanks a lot!

              – Lucas
              Oct 23 '14 at 10:35











            • Does not work for me.

              – boleslaw.smialy
              Jul 29 '15 at 12:20














            • 1





              ah, shift-menu is nice.

              – akira
              Oct 31 '10 at 11:50













            • How do you use this script exactly?

              – Jonathan
              Feb 1 '11 at 7:12











            • @Jonathan: Install Auto-HotKey (autohotkey.com). Copy the script contents to the AutoHotkey.ahk file. (probably in %USERPROFILE%documents) Restart Auto-Hotkey.

              – Leftium
              Feb 1 '11 at 8:17













            • This was the only working solution out of all the AutoHotkey snippets I found on the web. Thanks a lot!

              – Lucas
              Oct 23 '14 at 10:35











            • Does not work for me.

              – boleslaw.smialy
              Jul 29 '15 at 12:20








            1




            1





            ah, shift-menu is nice.

            – akira
            Oct 31 '10 at 11:50







            ah, shift-menu is nice.

            – akira
            Oct 31 '10 at 11:50















            How do you use this script exactly?

            – Jonathan
            Feb 1 '11 at 7:12





            How do you use this script exactly?

            – Jonathan
            Feb 1 '11 at 7:12













            @Jonathan: Install Auto-HotKey (autohotkey.com). Copy the script contents to the AutoHotkey.ahk file. (probably in %USERPROFILE%documents) Restart Auto-Hotkey.

            – Leftium
            Feb 1 '11 at 8:17







            @Jonathan: Install Auto-HotKey (autohotkey.com). Copy the script contents to the AutoHotkey.ahk file. (probably in %USERPROFILE%documents) Restart Auto-Hotkey.

            – Leftium
            Feb 1 '11 at 8:17















            This was the only working solution out of all the AutoHotkey snippets I found on the web. Thanks a lot!

            – Lucas
            Oct 23 '14 at 10:35





            This was the only working solution out of all the AutoHotkey snippets I found on the web. Thanks a lot!

            – Lucas
            Oct 23 '14 at 10:35













            Does not work for me.

            – boleslaw.smialy
            Jul 29 '15 at 12:20





            Does not work for me.

            – boleslaw.smialy
            Jul 29 '15 at 12:20













            106














            Press Alt+D, type cmd and press Enter. For more details see blog post here.






            share|improve this answer


























            • nice! the other option doesn't seem to show the "open command window here" option unless you right-click on a folder - inside the folder, it doesn't show

              – divillysausages
              Feb 26 '13 at 21:55











            • This opens a cmd window, but it does not open one at the current directory. The same thing can be accomplished with win+r, cmd

              – Ed Orsi
              Jul 2 '14 at 19:02











            • Note - You do not need to press Alt+d for this to work. All I had to do in Windows 7 was type cmd into the path of windows explorer and press enter. Alt+d just automatically selects the current path.

              – MiniRagnarok
              Jul 30 '15 at 12:50






            • 2





              Ctrl+L is an alternative.

              – pkr298
              Sep 29 '15 at 14:56











            • Beautiful! Simple

              – Uzumaki Naruto
              Mar 24 '17 at 6:52
















            106














            Press Alt+D, type cmd and press Enter. For more details see blog post here.






            share|improve this answer


























            • nice! the other option doesn't seem to show the "open command window here" option unless you right-click on a folder - inside the folder, it doesn't show

              – divillysausages
              Feb 26 '13 at 21:55











            • This opens a cmd window, but it does not open one at the current directory. The same thing can be accomplished with win+r, cmd

              – Ed Orsi
              Jul 2 '14 at 19:02











            • Note - You do not need to press Alt+d for this to work. All I had to do in Windows 7 was type cmd into the path of windows explorer and press enter. Alt+d just automatically selects the current path.

              – MiniRagnarok
              Jul 30 '15 at 12:50






            • 2





              Ctrl+L is an alternative.

              – pkr298
              Sep 29 '15 at 14:56











            • Beautiful! Simple

              – Uzumaki Naruto
              Mar 24 '17 at 6:52














            106












            106








            106







            Press Alt+D, type cmd and press Enter. For more details see blog post here.






            share|improve this answer















            Press Alt+D, type cmd and press Enter. For more details see blog post here.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Oct 26 '15 at 9:15









            Selfish

            1106




            1106










            answered May 27 '11 at 13:53









            Ashwin NanjappaAshwin Nanjappa

            4,8682558105




            4,8682558105













            • nice! the other option doesn't seem to show the "open command window here" option unless you right-click on a folder - inside the folder, it doesn't show

              – divillysausages
              Feb 26 '13 at 21:55











            • This opens a cmd window, but it does not open one at the current directory. The same thing can be accomplished with win+r, cmd

              – Ed Orsi
              Jul 2 '14 at 19:02











            • Note - You do not need to press Alt+d for this to work. All I had to do in Windows 7 was type cmd into the path of windows explorer and press enter. Alt+d just automatically selects the current path.

              – MiniRagnarok
              Jul 30 '15 at 12:50






            • 2





              Ctrl+L is an alternative.

              – pkr298
              Sep 29 '15 at 14:56











            • Beautiful! Simple

              – Uzumaki Naruto
              Mar 24 '17 at 6:52



















            • nice! the other option doesn't seem to show the "open command window here" option unless you right-click on a folder - inside the folder, it doesn't show

              – divillysausages
              Feb 26 '13 at 21:55











            • This opens a cmd window, but it does not open one at the current directory. The same thing can be accomplished with win+r, cmd

              – Ed Orsi
              Jul 2 '14 at 19:02











            • Note - You do not need to press Alt+d for this to work. All I had to do in Windows 7 was type cmd into the path of windows explorer and press enter. Alt+d just automatically selects the current path.

              – MiniRagnarok
              Jul 30 '15 at 12:50






            • 2





              Ctrl+L is an alternative.

              – pkr298
              Sep 29 '15 at 14:56











            • Beautiful! Simple

              – Uzumaki Naruto
              Mar 24 '17 at 6:52

















            nice! the other option doesn't seem to show the "open command window here" option unless you right-click on a folder - inside the folder, it doesn't show

            – divillysausages
            Feb 26 '13 at 21:55





            nice! the other option doesn't seem to show the "open command window here" option unless you right-click on a folder - inside the folder, it doesn't show

            – divillysausages
            Feb 26 '13 at 21:55













            This opens a cmd window, but it does not open one at the current directory. The same thing can be accomplished with win+r, cmd

            – Ed Orsi
            Jul 2 '14 at 19:02





            This opens a cmd window, but it does not open one at the current directory. The same thing can be accomplished with win+r, cmd

            – Ed Orsi
            Jul 2 '14 at 19:02













            Note - You do not need to press Alt+d for this to work. All I had to do in Windows 7 was type cmd into the path of windows explorer and press enter. Alt+d just automatically selects the current path.

            – MiniRagnarok
            Jul 30 '15 at 12:50





            Note - You do not need to press Alt+d for this to work. All I had to do in Windows 7 was type cmd into the path of windows explorer and press enter. Alt+d just automatically selects the current path.

            – MiniRagnarok
            Jul 30 '15 at 12:50




            2




            2





            Ctrl+L is an alternative.

            – pkr298
            Sep 29 '15 at 14:56





            Ctrl+L is an alternative.

            – pkr298
            Sep 29 '15 at 14:56













            Beautiful! Simple

            – Uzumaki Naruto
            Mar 24 '17 at 6:52





            Beautiful! Simple

            – Uzumaki Naruto
            Mar 24 '17 at 6:52











            42














            the native way to do something similar in windows7 is to hold down shift while pressing the right mouse onto the folder you want to "command prompt" to and a new menu item will appear in your context menu offering you exactly that: "open command prompt here".



            alt text



            if you want pure keyboard action then you have to do this:




            • open regedit

            • go to HKEY_CLASSES_ROOTDirectoryshellcmd and rename the Extended key to Extended_save

            • go to HKEY_CLASSES_ROOTDriveshellcmd and rename the 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. with autohotkeys you can do the same, but i do not know autohotkeys.






            share|improve this answer


























            • Thanks! I knew the first way, even it is simple enough, i still like the way of using keyboard shortcuts. And the second way seems a little complicated

              – Gemili
              Oct 31 '10 at 6:50











            • Love it, +1 10 char min

              – jcollum
              Apr 7 '11 at 15:34
















            42














            the native way to do something similar in windows7 is to hold down shift while pressing the right mouse onto the folder you want to "command prompt" to and a new menu item will appear in your context menu offering you exactly that: "open command prompt here".



            alt text



            if you want pure keyboard action then you have to do this:




            • open regedit

            • go to HKEY_CLASSES_ROOTDirectoryshellcmd and rename the Extended key to Extended_save

            • go to HKEY_CLASSES_ROOTDriveshellcmd and rename the 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. with autohotkeys you can do the same, but i do not know autohotkeys.






            share|improve this answer


























            • Thanks! I knew the first way, even it is simple enough, i still like the way of using keyboard shortcuts. And the second way seems a little complicated

              – Gemili
              Oct 31 '10 at 6:50











            • Love it, +1 10 char min

              – jcollum
              Apr 7 '11 at 15:34














            42












            42








            42







            the native way to do something similar in windows7 is to hold down shift while pressing the right mouse onto the folder you want to "command prompt" to and a new menu item will appear in your context menu offering you exactly that: "open command prompt here".



            alt text



            if you want pure keyboard action then you have to do this:




            • open regedit

            • go to HKEY_CLASSES_ROOTDirectoryshellcmd and rename the Extended key to Extended_save

            • go to HKEY_CLASSES_ROOTDriveshellcmd and rename the 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. with autohotkeys you can do the same, but i do not know autohotkeys.






            share|improve this answer















            the native way to do something similar in windows7 is to hold down shift while pressing the right mouse onto the folder you want to "command prompt" to and a new menu item will appear in your context menu offering you exactly that: "open command prompt here".



            alt text



            if you want pure keyboard action then you have to do this:




            • open regedit

            • go to HKEY_CLASSES_ROOTDirectoryshellcmd and rename the Extended key to Extended_save

            • go to HKEY_CLASSES_ROOTDriveshellcmd and rename the 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. with autohotkeys you can do the same, but i do not know autohotkeys.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 7 '11 at 16:53

























            answered Oct 31 '10 at 6:25









            akiraakira

            48.6k14112152




            48.6k14112152













            • Thanks! I knew the first way, even it is simple enough, i still like the way of using keyboard shortcuts. And the second way seems a little complicated

              – Gemili
              Oct 31 '10 at 6:50











            • Love it, +1 10 char min

              – jcollum
              Apr 7 '11 at 15:34



















            • Thanks! I knew the first way, even it is simple enough, i still like the way of using keyboard shortcuts. And the second way seems a little complicated

              – Gemili
              Oct 31 '10 at 6:50











            • Love it, +1 10 char min

              – jcollum
              Apr 7 '11 at 15:34

















            Thanks! I knew the first way, even it is simple enough, i still like the way of using keyboard shortcuts. And the second way seems a little complicated

            – Gemili
            Oct 31 '10 at 6:50





            Thanks! I knew the first way, even it is simple enough, i still like the way of using keyboard shortcuts. And the second way seems a little complicated

            – Gemili
            Oct 31 '10 at 6:50













            Love it, +1 10 char min

            – jcollum
            Apr 7 '11 at 15:34





            Love it, +1 10 char min

            – jcollum
            Apr 7 '11 at 15:34











            7














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



            If you are using Windows 8/10, there is a faster and original way :



            Alt + F, P



            Just three key and type twice , without help of another program.






            share|improve this answer






























              7














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



              If you are using Windows 8/10, there is a faster and original way :



              Alt + F, P



              Just three key and type twice , without help of another program.






              share|improve this answer




























                7












                7








                7







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



                If you are using Windows 8/10, there is a faster and original way :



                Alt + F, P



                Just three key and type twice , without help of another program.






                share|improve this answer















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



                If you are using Windows 8/10, there is a faster and original way :



                Alt + F, P



                Just three key and type twice , without help of another program.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 20 '17 at 10:17









                Community

                1




                1










                answered Jul 31 '16 at 4:20









                MithrilMithril

                396517




                396517























                    1














                    AutoHotKey script to open command prompt using @Ashwin's method



                    Open Powershell console using Win P



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


                    Open command prompt using Win C



                    #C::
                    {
                    Send !D
                    Send CMD
                    Send {Enter}
                    return
                    }





                    share|improve this answer






























                      1














                      AutoHotKey script to open command prompt using @Ashwin's method



                      Open Powershell console using Win P



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


                      Open command prompt using Win C



                      #C::
                      {
                      Send !D
                      Send CMD
                      Send {Enter}
                      return
                      }





                      share|improve this answer




























                        1












                        1








                        1







                        AutoHotKey script to open command prompt using @Ashwin's method



                        Open Powershell console using Win P



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


                        Open command prompt using Win C



                        #C::
                        {
                        Send !D
                        Send CMD
                        Send {Enter}
                        return
                        }





                        share|improve this answer















                        AutoHotKey script to open command prompt using @Ashwin's method



                        Open Powershell console using Win P



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


                        Open command prompt using Win C



                        #C::
                        {
                        Send !D
                        Send CMD
                        Send {Enter}
                        return
                        }






                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Mar 20 '17 at 10:17









                        Community

                        1




                        1










                        answered Oct 15 '11 at 16:35









                        iraSenthiliraSenthil

                        1,06376




                        1,06376























                            1














                            Easiest way is to goto the windows explorer address bar and type in cmd, it wil lopen the command prompt immediately from that location.






                            share|improve this answer
























                            • Please read the question again carefully. Your answer does not answer the original question, which asks for a keyboard shortcut.

                              – DavidPostill
                              Jun 3 '16 at 9:58
















                            1














                            Easiest way is to goto the windows explorer address bar and type in cmd, it wil lopen the command prompt immediately from that location.






                            share|improve this answer
























                            • Please read the question again carefully. Your answer does not answer the original question, which asks for a keyboard shortcut.

                              – DavidPostill
                              Jun 3 '16 at 9:58














                            1












                            1








                            1







                            Easiest way is to goto the windows explorer address bar and type in cmd, it wil lopen the command prompt immediately from that location.






                            share|improve this answer













                            Easiest way is to goto the windows explorer address bar and type in cmd, it wil lopen the command prompt immediately from that location.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jun 3 '16 at 2:43









                            Syed. ASyed. A

                            111




                            111













                            • Please read the question again carefully. Your answer does not answer the original question, which asks for a keyboard shortcut.

                              – DavidPostill
                              Jun 3 '16 at 9:58



















                            • Please read the question again carefully. Your answer does not answer the original question, which asks for a keyboard shortcut.

                              – DavidPostill
                              Jun 3 '16 at 9:58

















                            Please read the question again carefully. Your answer does not answer the original question, which asks for a keyboard shortcut.

                            – DavidPostill
                            Jun 3 '16 at 9:58





                            Please read the question again carefully. Your answer does not answer the original question, which asks for a keyboard shortcut.

                            – DavidPostill
                            Jun 3 '16 at 9:58











                            1














                            As of the latest Windows 10 update, Leftium's answer's Shift + Menu, W method no longer works. However, a small modification can present a workaround, albeit with a few more keystrokes.



                            The problem is that Command Prompt is no longer available in the Extended Right-Click Menu. Instead, you now have Windows Powershell.



                            Shift + Menu, S opens up Windows Powershell in the target folder. Once in Windows Powershell, type cmd then press Enter.



                            This will give you access to Command Prompt within Windows Powershell.



                            P.S.



                            Ashwin Nanjappa's method of Ctrl + L, type cmd then press Enter works. However, it is elegant only if you do not intend to return to the Windows Explorer window to continue navigating among directories. Unfortunately the method brings your cursor in Windows Explorer away from the main window and requires a number of Tab keystrokes to get it back to where you can navigate folders using the arrow keys. This can be frustrating as there is limited visual confirmation when you are pressing those Tab keystrokes.



                            Whereas Windows Powershell does work in most ways identically to Command Prompt, I have encountered at least one case in which Windows Powershell was erroneously misreading my @tags (when I was generating javadocs) and not producing the desired result. By typing cmd then Enter within Windows Powershell, you can use Command Prompt instead which overcomes such issues.






                            share|improve this answer






























                              1














                              As of the latest Windows 10 update, Leftium's answer's Shift + Menu, W method no longer works. However, a small modification can present a workaround, albeit with a few more keystrokes.



                              The problem is that Command Prompt is no longer available in the Extended Right-Click Menu. Instead, you now have Windows Powershell.



                              Shift + Menu, S opens up Windows Powershell in the target folder. Once in Windows Powershell, type cmd then press Enter.



                              This will give you access to Command Prompt within Windows Powershell.



                              P.S.



                              Ashwin Nanjappa's method of Ctrl + L, type cmd then press Enter works. However, it is elegant only if you do not intend to return to the Windows Explorer window to continue navigating among directories. Unfortunately the method brings your cursor in Windows Explorer away from the main window and requires a number of Tab keystrokes to get it back to where you can navigate folders using the arrow keys. This can be frustrating as there is limited visual confirmation when you are pressing those Tab keystrokes.



                              Whereas Windows Powershell does work in most ways identically to Command Prompt, I have encountered at least one case in which Windows Powershell was erroneously misreading my @tags (when I was generating javadocs) and not producing the desired result. By typing cmd then Enter within Windows Powershell, you can use Command Prompt instead which overcomes such issues.






                              share|improve this answer




























                                1












                                1








                                1







                                As of the latest Windows 10 update, Leftium's answer's Shift + Menu, W method no longer works. However, a small modification can present a workaround, albeit with a few more keystrokes.



                                The problem is that Command Prompt is no longer available in the Extended Right-Click Menu. Instead, you now have Windows Powershell.



                                Shift + Menu, S opens up Windows Powershell in the target folder. Once in Windows Powershell, type cmd then press Enter.



                                This will give you access to Command Prompt within Windows Powershell.



                                P.S.



                                Ashwin Nanjappa's method of Ctrl + L, type cmd then press Enter works. However, it is elegant only if you do not intend to return to the Windows Explorer window to continue navigating among directories. Unfortunately the method brings your cursor in Windows Explorer away from the main window and requires a number of Tab keystrokes to get it back to where you can navigate folders using the arrow keys. This can be frustrating as there is limited visual confirmation when you are pressing those Tab keystrokes.



                                Whereas Windows Powershell does work in most ways identically to Command Prompt, I have encountered at least one case in which Windows Powershell was erroneously misreading my @tags (when I was generating javadocs) and not producing the desired result. By typing cmd then Enter within Windows Powershell, you can use Command Prompt instead which overcomes such issues.






                                share|improve this answer















                                As of the latest Windows 10 update, Leftium's answer's Shift + Menu, W method no longer works. However, a small modification can present a workaround, albeit with a few more keystrokes.



                                The problem is that Command Prompt is no longer available in the Extended Right-Click Menu. Instead, you now have Windows Powershell.



                                Shift + Menu, S opens up Windows Powershell in the target folder. Once in Windows Powershell, type cmd then press Enter.



                                This will give you access to Command Prompt within Windows Powershell.



                                P.S.



                                Ashwin Nanjappa's method of Ctrl + L, type cmd then press Enter works. However, it is elegant only if you do not intend to return to the Windows Explorer window to continue navigating among directories. Unfortunately the method brings your cursor in Windows Explorer away from the main window and requires a number of Tab keystrokes to get it back to where you can navigate folders using the arrow keys. This can be frustrating as there is limited visual confirmation when you are pressing those Tab keystrokes.



                                Whereas Windows Powershell does work in most ways identically to Command Prompt, I have encountered at least one case in which Windows Powershell was erroneously misreading my @tags (when I was generating javadocs) and not producing the desired result. By typing cmd then Enter within Windows Powershell, you can use Command Prompt instead which overcomes such issues.







                                share|improve this answer














                                share|improve this answer



                                share|improve this answer








                                edited Feb 9 '18 at 6:58

























                                answered Feb 8 '18 at 3:24









                                QladstoneQladstone

                                112




                                112























                                    0














                                    If you are using a german languaged Windows version you can do this:



                                    Press Alt+D,E



                                    Alt+D opens a menu where you can select a few other things besides the cmd






                                    share|improve this answer


























                                    • Alt+D select the Address Bar, not a menu

                                      – Canadian Luke
                                      Jul 29 '15 at 18:03











                                    • Seems to only work on German languaged Windows versions

                                      – foobarbaz
                                      Jul 29 '15 at 22:55











                                    • Edit your answer then I can remove the down vote

                                      – Canadian Luke
                                      Jul 29 '15 at 22:58
















                                    0














                                    If you are using a german languaged Windows version you can do this:



                                    Press Alt+D,E



                                    Alt+D opens a menu where you can select a few other things besides the cmd






                                    share|improve this answer


























                                    • Alt+D select the Address Bar, not a menu

                                      – Canadian Luke
                                      Jul 29 '15 at 18:03











                                    • Seems to only work on German languaged Windows versions

                                      – foobarbaz
                                      Jul 29 '15 at 22:55











                                    • Edit your answer then I can remove the down vote

                                      – Canadian Luke
                                      Jul 29 '15 at 22:58














                                    0












                                    0








                                    0







                                    If you are using a german languaged Windows version you can do this:



                                    Press Alt+D,E



                                    Alt+D opens a menu where you can select a few other things besides the cmd






                                    share|improve this answer















                                    If you are using a german languaged Windows version you can do this:



                                    Press Alt+D,E



                                    Alt+D opens a menu where you can select a few other things besides the cmd







                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited Jul 29 '15 at 23:03

























                                    answered Jun 27 '14 at 14:16









                                    foobarbazfoobarbaz

                                    111




                                    111













                                    • Alt+D select the Address Bar, not a menu

                                      – Canadian Luke
                                      Jul 29 '15 at 18:03











                                    • Seems to only work on German languaged Windows versions

                                      – foobarbaz
                                      Jul 29 '15 at 22:55











                                    • Edit your answer then I can remove the down vote

                                      – Canadian Luke
                                      Jul 29 '15 at 22:58



















                                    • Alt+D select the Address Bar, not a menu

                                      – Canadian Luke
                                      Jul 29 '15 at 18:03











                                    • Seems to only work on German languaged Windows versions

                                      – foobarbaz
                                      Jul 29 '15 at 22:55











                                    • Edit your answer then I can remove the down vote

                                      – Canadian Luke
                                      Jul 29 '15 at 22:58

















                                    Alt+D select the Address Bar, not a menu

                                    – Canadian Luke
                                    Jul 29 '15 at 18:03





                                    Alt+D select the Address Bar, not a menu

                                    – Canadian Luke
                                    Jul 29 '15 at 18:03













                                    Seems to only work on German languaged Windows versions

                                    – foobarbaz
                                    Jul 29 '15 at 22:55





                                    Seems to only work on German languaged Windows versions

                                    – foobarbaz
                                    Jul 29 '15 at 22:55













                                    Edit your answer then I can remove the down vote

                                    – Canadian Luke
                                    Jul 29 '15 at 22:58





                                    Edit your answer then I can remove the down vote

                                    – Canadian Luke
                                    Jul 29 '15 at 22:58











                                    0














                                    For AHK, following is my binding:



                                    #c::
                                    Run, C:Windowssystem32cmd.exe
                                    return


                                    This does not open current folder, but it is handy.






                                    share|improve this answer




























                                      0














                                      For AHK, following is my binding:



                                      #c::
                                      Run, C:Windowssystem32cmd.exe
                                      return


                                      This does not open current folder, but it is handy.






                                      share|improve this answer


























                                        0












                                        0








                                        0







                                        For AHK, following is my binding:



                                        #c::
                                        Run, C:Windowssystem32cmd.exe
                                        return


                                        This does not open current folder, but it is handy.






                                        share|improve this answer













                                        For AHK, following is my binding:



                                        #c::
                                        Run, C:Windowssystem32cmd.exe
                                        return


                                        This does not open current folder, but it is handy.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered May 14 '18 at 14:52









                                        Teoman shipahiTeoman shipahi

                                        1115




                                        1115























                                            0














                                            A simpler AHK script than the one in the selected question



                                            #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






                                            share|improve this answer




























                                              0














                                              A simpler AHK script than the one in the selected question



                                              #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






                                              share|improve this answer


























                                                0












                                                0








                                                0







                                                A simpler AHK script than the one in the selected question



                                                #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






                                                share|improve this answer













                                                A simpler AHK script than the one in the selected question



                                                #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







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered Dec 28 '18 at 11:59









                                                MagTunMagTun

                                                420720




                                                420720






























                                                    draft saved

                                                    draft discarded




















































                                                    Thanks for contributing an answer to Super User!


                                                    • Please be sure to answer the question. Provide details and share your research!

                                                    But avoid



                                                    • Asking for help, clarification, or responding to other answers.

                                                    • Making statements based on opinion; back them up with references or personal experience.


                                                    To learn more, see our tips on writing great answers.




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function () {
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f205359%2fhow-can-i-open-a-command-prompt-in-current-folder-with-a-keyboard-shortcut%23new-answer', 'question_page');
                                                    }
                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    Plaza Victoria

                                                    In PowerPoint, is there a keyboard shortcut for bulleted / numbered list?

                                                    How to put 3 figures in Latex with 2 figures side by side and 1 below these side by side images but in...