Antwoorden (11)
Oplossing gevonden!
Gebruik deze toetsenbordcombinatie: Shift + Menu, W, Voer
in 1. Shift + Menu (alternatief, Shift + F10), (opent uitgebreid rechtsklik menu in de huidige map)
W (kiest “Open Command Venster Hier”),
- Enter (activeert selectie; vereist omdat “New” ook met W te selecteren is)
De Menu-toets verwijst naar de speciale toets die door Microsoft is geïntroduceerd, meestal rechts van de rechter Win-toets.
Deze snelkoppeling is beschikbaar op een standaard installatie van Windows (7) zonder software van derden.
- *
De AHK-manier. U hoeft alleen maar op Win + C te drukken (of wat u ook wilt definiëren als.):
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:\ "
}
}
Als bonus maakt het bovenstaande script ook een nieuw tekstbestand aan met deze snelkoppeling: Win + T
Credit to: Eli Bendersky (https://stackoverflow.com/questions/98597/best-autohotkey-macros/100648#100648)
Druk op Alt+D, typ cmd en druk op Enter. Voor meer details zie blogpost hier .
de oorspronkelijke manier om iets dergelijks te doen in windows7 is om de shift ingedrukt te houden terwijl je met de rechtermuisknop op de map drukt waar je “command prompt” naartoe wilt en er verschijnt een nieuw menu-item in je contextmenu dat je precies dat biedt: “open commando prompt hier”.
als je pure toetsenbordactie wilt dan moet je dit doen:
- open
regedit - ga naar
HKEY_CLASSES_ROOT\Directory\shell\cmden hernoem deExtendedtoets naarExtended_save - ga naar
HKEY_CLASSES_ROOT\Drive\shell\cmden hernoem deExtended 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 cdctrlventer
which grabs the current path from the address bar of explorer and executes cmd /k cd PATH. met autohotkeys kun je hetzelfde doen, maar ik ken geen autohotkeys.
Van how-to-open-cmd-in-current-folder-by-shortcut-windows-10
Als u Windows 8/10 gebruikt, is er een snellere en originele manier :
Alt + F, P
Gewoon drie toetsen en twee keer typen , zonder hulp van een ander programma.
Vanaf de laatste update van Windows 10 werkt de methode Shift + Menu, W van Leftium niet meer. Een kleine aanpassing kan echter een workaround opleveren, zij het met een paar extra toetsaanslagen.
Het probleem is dat Command Prompt niet meer beschikbaar is in het Extended Right-Click Menu. In plaats daarvan heb je nu Windows Powershell.
Shift + Menu, S opent Windows Powershell in de doelmap. Eenmaal in Windows Powershell, type cmd en druk dan op Enter.
Dit geeft u toegang tot Command Prompt binnen Windows Powershell.
P.S.
Ashwin Nanjappa’s methode van Ctrl + L, type cmd en druk dan op Enter werkt. Het is echter alleen elegant als u niet van plan bent om terug te keren naar het Windows Verkenner-venster om verder te navigeren tussen mappen. Helaas brengt de methode uw cursor in Windows Verkenner weg van het hoofdvenster en vereist een aantal Tab-toetsaanslagen om hem terug te brengen naar de plaats waar u met de pijltjestoetsen door mappen kunt navigeren. Dit kan frustrerend zijn omdat er een beperkte visuele bevestiging is wanneer je die Tab-toetsen indrukt.
Terwijl Windows Powershell op de meeste manieren identiek werkt aan Command Prompt, ben ik minstens één geval tegengekomen waarin Windows Powershell mijn @tags verkeerd heeft gelezen (toen ik javadocs aan het genereren was) en niet het gewenste resultaat heeft opgeleverd. Door het typen van cmd en vervolgens Enter binnen Windows Powershell, kunt u in plaats daarvan Command Prompt gebruiken die dergelijke problemen overwint.
AutoHotKey script om opdrachtprompt te openen met behulp van @Ashwin methode
Open Powershell console met behulp van Win P
#P::
{
Send !D
Send powershell
Send {Enter}
return
}
Open opdrachtprompt met behulp van Win C
#C::
{
Send !D
Send CMD
Send {Enter}
return
}
Een eenvoudiger AHK-script dan het script in de geselecteerde vraag
#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
}
bron van hier: https://autohotkey.com/boards/viewtopic.php?t=5796
Voor AHK is mijn binding:
#c::
Run, C:\Windows\system32\cmd.exe
return
Dit opent de huidige map niet, maar het is wel handig.
