Risposte (11)
Soluzione trovata!
Utilizza questa scorciatoia da tastiera: Shift + Menu, W, Enter
Shift + Menu (in alternativa, Shift + F10), (apre il menu esteso con il tasto destro del mouse nella cartella corrente)
W (seleziona “Apri qui la finestra di comando”),
- Enter (attiva la selezione; richiesto poiché “Nuovo” è selezionabile anche con W)
Il tasto Menu si riferisce al tasto speciale introdotto da Microsoft, di solito a destra del tasto Win.
Questa scorciatoia è disponibile su un'installazione predefinita di Windows (7) senza software di terze parti.
La via AHK. Basta premere Win + C (o qualsiasi cosa si voglia definire come.):
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:\ "
}
}
Come bonus, lo script qui sopra crea anche un nuovo file di testo con questa scorciatoia: Win + T
Credit to: Eli Bendersky
Premere Alt+D, digitare cmd e premere Invio. Per maggiori dettagli vedere il post del blog qui .
il modo nativo per fare qualcosa di simile in windows7 è quello di tenere premuto il tasto shift mentre si preme il tasto destro del mouse sulla cartella in cui si desidera “command prompt” e una nuova voce di menu apparirà nel menu contestuale che vi offrirà esattamente questo: “
se volete la pura azione della tastiera dovete fare così:
- aprire
regedit - andare a
HKEY_CLASSES_ROOT\Directory\shell\cmde rinominare il tastoExtendedinExtended_save - andare a
HKEY_CLASSES_ROOT\Drive\shell\cmde rinominare il tastoExtended 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. Con gli autohotkeys si può fare lo stesso, ma non conosco gli autohotkeys.
Da how-to-open-cmd-in-current-folder-by-shortcut-windows-10
Se si utilizza Windows 8/10, c'è un modo più veloce e originale :
Alt + F, P
Solo tre tasti e digitare due volte, senza l'aiuto di un altro programma.
A partire dall'ultimo aggiornamento di Windows 10, il metodo Shift + Menu, W della risposta di Leftium non funziona più. Tuttavia, una piccola modifica può presentare un workaround, anche se con qualche battuta in più.
Il problema è che il prompt dei comandi non è più disponibile nel menu esteso del tasto destro. Invece, ora avete Windows Powershell.
Shift + Menu, S apre Windows Powershell nella cartella di destinazione. Una volta in Windows Powershell, digitare cmd e poi premere Invio.
Questo vi darà accesso al prompt dei comandi all'interno di Windows Powershell.
P.S.
Il metodo di Ashwin Nanjappa di Ctrl + L, digitare cmd e poi premere Invio funziona. Tuttavia, è elegante solo se non si intende tornare alla finestra di Windows Explorer per continuare a navigare tra le directory. Purtroppo il metodo porta il cursore in Windows Explorer lontano dalla finestra principale e richiede un certo numero di tasti Tab per tornare a navigare tra le cartelle con i tasti freccia. Questo può essere frustrante perché c'è una limitata conferma visiva quando si preme quei tasti Tab.
Mentre Windows Powershell funziona nella maggior parte dei casi in modo identico a Command Prompt, ho incontrato almeno un caso in cui Windows Powershell ha erroneamente letto male i miei @tags (quando stavo generando javadocs) e non ha prodotto il risultato desiderato. Digitando cmd e poi Enter all'interno di Windows Powershell, è possibile utilizzare Command Prompt invece che risolve tali problemi.
Script AutoHotKey per aprire il prompt dei comandi usando il metodo @Ashwin’s method
Open Powershell console usando Win P
#P::
{
Send !D
Send powershell
Send {Enter}
return
}
Open command prompt usando Win C
#C::
{
Send !D
Send CMD
Send {Enter}
return
}
Uno script AHK più semplice di quello della domanda selezionata
#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
}
fonte da qui : https://autohotkey.com/boards/viewtopic.php?t=5796
Per AHK, il mio rilegatura è la seguente:
#c::
Run, C:\Windows\system32\cmd.exe
return
Questa non apre la cartella corrente, ma è utile.
