How to assign a keyboard shortcut to open in terminal option in windows 11 which we get when we right click in a folder? Actually I want the terminal's path same as directory's path which we get when we right click and choose open in terminal option
I have been looking for this. I was using ALT - F - R to open powershell on Windows 10. For Win11 the closest thing to shortcut i could give is
press F4 in directory
CTRL + A to select all path
write cmd or wt and hit enter.
It will open cmd or terminal with directory's path.
Just came back to this, the best method I have is press the menu key if your keyboard has it (same as right clicking) or press SHIFT-F10. Then press T for terminal (Up until a few versions ago terminal didn't have a shortcut, I raised an issue ( https://github.com/microsoft/terminal/issues/13061 ) and it got fixed in July.
Still not as fool proof as the old ALT - F - R method or as universal ( it depends if you have other shortcuts that have T has their accelerator key ).
Related
How to execute a copy paste operation from Windows 10 to the Bash on Ubuntu on Windows environment?
I tried the following:
ctrl + shift + v
right click to paste
Any suggestions?
Update 2019/04/16: It seems copy/paste is now officially supported in Windows build >= 17643. Take a look at Rich Turner's answer. This can be enabled through the same settings menu described below by clicking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste".
Another solution would be to enable "QuickEdit Mode" and then you can paste by right-clicking in the terminal.
To enable QuickEdit Mode, right-click on the toolbar (or simply click on the icon in the upper left corner), select Properties, and in the Options tab, click the checkbox next to QuickEdit Mode.
With this mode enabled, you can also copy text in the terminal by clicking and dragging. Once a selection is made, you can press Enter or right-click to copy.
To get right-click to paste to work:
Right-click on the title bar > Properties
Options tab > Edit options > enable QuickEdit Mode
At long last, we're excited to announce that we FINALLY implemented copy and paste support for Linux/WSL instances in Windows Console via CTRL + SHIFT + [C|V]!
You can enable/disable this feature in case you find a keyboard collision with a command-line app, but this should start working when you install and run any Win10 builds >= 17643. Select "Properties" from the menu to access the following dialog box.
Thanks for your patience while we re-engineered Console's internals to allow this feature to work :)
You can use AutoHotkey (third party application), the command below is good with plain alphanumeric text, however some other characters like =^"%#! are mistyped in console like bash or cmd. (In any non-console window this command works fine with all characters.)
^+v::SendRaw %clipboard%
Right-click the title bar, select context menu Edit -> Paste (until they fix the control key shortcuts)
As others have said, there is now an option for Ctrl+Shf+Vfor paste in Windows 10 Insider build #17643.
Unfortunately this isn't in my muscle memory and as a user of TTY terminals I'd like to use Shf+Ins as I do on all the Linux boxes I connect to.
This is possible on Windows 10 if you install ConEmu which wraps the terminal in a new GUI and allows Shf+Ins for paste. It also allows you to tweak the behaviour in the Properties.
The Console looks like this:
Copy options:
Paste options:
Shf+Ins works out of the box. I can't remember if you need to configure bash as one of the shells it uses but if you do, here is the task properties to add it:
Also allows tabbed Consoles (including different types, cmd.exe, powershell etc). I've been using this since early Windows 7 and in those days it made the command line on Windows usable!
Like it has been written before:
Right Click on Bash on Ubuntu on Windows Icon if you have it on a Task Bar Shortcut Icon
Click on Properties
Select Options Tab on the Properties Window
Check the QuickEditMode option
Click Apply
Now you are able to open a new Bash Terminal and just use Right-Click to paste
In order to be able to copy from Terminal, Just use CTRL+M and this will enable you to select and copy selected Text.
For pasting into Vim in the terminal (bash on ubuntu on windows):
export DISPLAY=localhost:0.0
Not sure how to copy from Vim though :-(
Alternate solution over here, my windows home version Windows Subsystem Linux terminal doesn't have the property to use Shift+Ctrl (C|V)
Use an actual linux terminal]1
Install an X-server in Windows (like X-Ming)
sudo apt install <your_favorite_terminal>
export DISPLAY=:0
fire your terminal app, I tested with xfce4-terminal and gnome-terminal
windows #ubuntu #development
For just copying (possibly long) texts to the Windows clipboard, I have found that just piping the output to clip.exe (including the .exe file extension) works fine for me. So:
$ echo "Hello World" | clip.exe
lets me paste Hello World using Ctrl-V anywhere else.
Now that I have posted this, I notice that related question Pipe from clipboard in linux subsytem for windows includes this and a command solution for pasting from the Windows clipboard as well.
you might have bash but it is still a windows window manager. Highlite some text in the bash terminal window. Right click on the title bar, select "Edit", select "Copy", Now Right Click again on the Title bar, select "Edit" , Select "Paste", Done. You should be able to Highlite text, hit "Enter" then Control V but this seems to be broken
For autohotkey users, a full answer is:
#IfWinActive ahk_class ConsoleWindowClass
^+v::SendInput %clipboard%
Which checks that you're in a console (windows or ubuntu) before pasting from the windows clipboard.
That turned out to be pretty simple. I've got it occasionally. To paste a text you simply need to right mouse button click anywhere in terminal window.
I am trying to list all of the programs currently on my Windows 8.1 machine. I believe recently installed software is preventing windows from booting up. I have access to the command line and I have been trying to use the wmic product GET Name to see what I can uninstall from the command line. I read that you have to enable the WMI support tools in Management & Monitoring Tools, but I don't have access to that. Does anyone know if I can enable that from the command line so I can figure out why I am ultimately getting a EDIT:0x000021a error on start up.
Try
This is not a full list (wmic). This is only products installed with Windows Installer. There is no feature for everything.
However as I said in my previous post nearly everything is listed in the registry.
So to see it in a command prompt
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /s
Also your error code seems invalid. There is no 27a windows error or 0xc000027a NT Status code. It seems wrong for a COM containing NTSTatus 0xd000027a or COM with Windows error 0x8007027a.
Clean Booting
Each of the three steps turns of programs, services, and drivers in increasing amounts. Thus narrowing down the possible culprits.
Clean Boot
Click Start - All Programs - Accessories - Run and type
msconfig
Then go to the Startup tab. Untick everything. Then go to the Services tab. Tick Hide All Microsoft Services and untick everything that's left.
Reboot. If this solves your problem reenable ½ of the services/startup items until you find which one.
Advanced Clean Boot
If the above doesn't help.
Download Autoruns from http://technet.microsoft.com/en-us/sysinternals/bb963902.aspx
Start the program by right clicking and choosing Run As Administrator and click Options menu - Filter Options and tick Hide Microsoft entries and clear Include Empty Locations. Untick everything left.
Reboot. If this solves your problem reenable ½ of the items until you find which one.
Safe Mode
If the above doesn't help.
Use Safe Mode with Networking if you need internet access.
Click Start - All Programs - Accessories - Run and type
msconfig
Then go to the Boot tab and click Safe Boot (also tick Network if needed). Reboot. Come back here and untick Safe Boot to return to normal mode.
or
If your computer has a single operating system installed, repeatedly press the F8 key as your computer restarts. You need to press F8 before the Windows logo appears. If the Windows logo appears, you will need to try again. [From Start - Help and Support]
Startup Repair
If your computer has a single operating system installed, repeatedly press the F8 key as your computer restarts. You need to press F8 before the Windows logo appears. If the Windows logo appears, you will need to try again. [From Start - Help and Support].
On the Advanced Boot Options screen, use the arrow keys to highlight Repair your computer, and then press ENTER.
Select Startup Repair.
Startup repair makes a log file. See C:\Windows\System32\LogFiles\Srt\SrtTrail.txt.
To access if Windows won't start, on the Advanced Boot Options screen, use the arrow keys to highlight Repair your computer, and then press ENTER.
Select Command Prompt.
Type
type C:\Windows\System32\LogFiles\Srt\SrtTrail.txt |more
Also type explorer in your command prompt and see what happens.
My Explorer fixes listsways of using windows without the graphical shell.
To See if a Fix is Available
In Control Panel (and select Classic view in the left hand pane) choose Problem Reports and Solutions (type problem in Start's search box), go to Problem History, right click your error and choose Check For Solution.
You may also right click and choose Details for more info. Post those details here. The Fault Module Name is the important information.
If the problem affects Control Panel press Winkey + R and type wercon (or type it in a command prompt).
Close Explorer and Start a Command Prompt
Close any Explorer windows
Start - All Programs - Accessories - Right click Command Prompt and choose Run As Administrator.
Click Start. Ctrl + Shift + Right click a blank spot (just above the power buttons is one place) then Exit Explorer.
Press Ctrl + Alt + Delete then Task Manager.
Check all explorer processes are closed. On the Process tab select explorer and right click and choose End Process, repeat if more than one explorer in the list.
Then to restart explorer after trying each of the following
Press Ctrl + Alt + Delete and choose Task Manager
In Task Manager click the File menu then New Task (Run) and type explorer
If You Can't Start Explorer at All
Press Ctrl + Alt + Delete and choose Task Manager
On the Process tab click Show Processes From All Users to elevate to Administrator
In Task Manager click the File menu then New Task (Run) and type cmd
Other things you can try typing
Explorer
Explorer c:\
Explorer /e,c:\
wercon
control
iexplore
rstrui
If you can't start a folder window use the Browse button in the New Task dialog. Remember you need to right click and choose Open rather than double clicking.
In Chrome, it's possible to switch tabs with cmd + tab_number, like cmd + 3 to go to the third tab. Is there anyway to specify this for Terminal on a Mac running Mavericks?
I know how to change a shortcut via System Preferences, but I'm not the exact name of the Menu Command I should add, if it's even possible.
You can Shift + Command + Left or Right Arrow to cycle through tabs:
Shift ⌘ ←→
or
⌘{}
If you want to use a specific # as you mentioned then you'll have to script it or use windows instead of tabs.
Microsoft's powertoy is relatively well known. But it requires you to open a cmd one level above, from where you'd usually like. So I found this nice app, CmdOpenInstall (let's make the man some traffic :-) - it enables you to open cmd in the current directory.
Is there a way to assign a keyboard shortcut to the command (which appears on right click menu) ? How ?
p.s. I know this is maybe not a strict programing subject, but I still think it has more chances of being answered here then on SF.
If you find the context menu entry in the registry (I think it would be in HKEY_CLASSES_ROOT\Folder\shell somewhere), you can prefix the character you want as hotkey in that menu with a & to force it as keyboard accelerator.
But apart from that you can't (at least not without addditional tools I don't know any of) make direct keyboard shortcuts to functions in a context menu. But I think something like Menu key and another letter comes close enough in everyday use.
Here are the registry keys I use to easily open command windows. Here 'C' is the shortcut key.
To use, save to a .reg file and merge into your registry.
Windows Registry Editor Version 5.00
;Right click on folder and open up command window
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd1]
#="Open &Command Prompt Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd1\command]
#="cmd.exe /k pushd \"%L\""
;Right click on any file and open up command window
[HKEY_CLASSES_ROOT\*\shell\cmd1]
#="Open &Command Prompt Here"
[HKEY_CLASSES_ROOT\*\shell\cmd1\command]
#="cmd.exe %1"
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.
I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside the folder if you are already there. I know you can navigate to the parent directory, and use it from there, but if the parent has thousands of directories in it, this is not so convenient. I have tried some home-brewed batch files associated with folder actions in explorer, but those suffer from similar problems.
So, what is the quickest way to open a command prompt with a working directory of the current windows explorer folder?
My current approach: (horrible)
Alt - D, Ctrl - C (copy path)
Win - R, "cmd", Enter (start command prompt)
"cd", Space (start a change directory command)
Alt - Space, e, p (paste directory)
Enter (execute change directory)
I know there is something better! What is it?
Hold Shift while Right-Clicking a blank space in the desired folder to bring up a more verbose context menu. One of the options is Open Command Window Here. This works in Windows Vista, 7, 8, and 10. Since Windows 10 Creators Update, the option has been replaced with Open PowerShell Here. However, there are ways to enable Open Command Window Here again.
Just type "cmd" to location bar, that's it. It will start a new command prompt in current path.
This solution was confirmed to work in Windows XP, Vista, 7, 8 and 10 (including Creators Update).
Keystrokes to move the focus to the location bar:
AltD in English (pointed out by Tim Stewart in the comments)
AltE in German
Inside your current folder, simply press Shift+Alt+F --then--> Enter.
The prompt will appear with your current folder's path set.
Note: That works only in Windows 7 / Vista. What it does is that drops the "File" menu down for you, because the "Shift" key is pressed the option "Open command window here" is enabled and focused as the first available option of "File" menu. Pressing enter starts the focused option therefor the command window.
Edit:
In case you are in a folder and you already selected some of its contents (file/folder) this wont work. In that case Click on the empty area inside the folder to deselect any previously selected files and repeat.
Edit2:
Another way you can open terminal in current directory is to type cmd on file browser navigation bar where the path of current folder is written.
In order to focus with your keyboard on the navigation bar Ctrl+L. Then you can type cmd and hit Enter
Right-click the title-bar icon of the Explorer window. You'll get the current folder's context menu, where you'll find the "command window here" item.
(Note that to see that menu item, you need to have the corresponding "power toy" installed, or you can create the right registry keys yourself to add that item to folders' context menus.)
As a very quick solution I can give you this. I tested this on Windows 8.1
1- Find File and Right Click on Command Prompt on File Explorer and then add command prompt to your Quick Access Toolbar:
2- After adding it you can access the folder from here:
That will open a command prompt in there for you.
On vista and windows 7:
Alt+d -> it will put focus on the address bar of the explorer window
and then, type the name of any program you would launch using WIN+r
hit Enter
The program will start with its current directory set to that of the explorer instance.
e.g.:python, ghci, powershell, cmd, etc...
For Windows vista and Windows 7 ,to open the command prompt
1) go to folder you want to work
2)In address bar type- cmd
press enter
it will open the command prompt for that location
You can edit the registry to add the Command Prompt item to the context menu. Here are a couple of .reg files that I use.
Cmdhere.reg - for WinNT/2000/XP/Vista/7:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
#="Command Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
#="cmd.exe /k cd %1"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew]
#="Command Prompt"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew\Command]
#="cmd.exe /k cd %1"
Doshere.reg - for Win9x:
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
#="MS-DOS Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
#="command.com /k cd %1"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew]
#="MS-DOS Prompt"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew\Command]
#="command.com /k cd %1"
Copy this into an empty text file and change the extension to .reg. Double-clicking on this in Windows Explorer will add these key to the registry.
I use StExBar, a Windows Explorer extension that gives you a command prompt button in explorer along with some other cool features (copy path, copy file name & more).
https://tools.stefankueng.com/StExBar.html
EDIT:
I just found out (been using it for more than a year and did not know this) that Ctrl+M will do it with StExBar. How's that for fast!
Almost the same as yours:
Alt+d, Ctrl+c
Win+r
cmd /K cd , Ctrl+v, ENTER
If that's so bothering, you could try to switch to windows explorer alternative like freecommander which has a toolbar button for that purpose.
I use a lot the "Send To" functionality.
I create my own batch (.bat) files in the shell:sendto folder and send files/folders to them using the context menu (to get there just write 'shell:sendto' in location bar).
I have scripts to perform all sort of things: send files by ftp, launch a php server in the current folder, create folders named with the current date, copy sent path to clipboard, etc.
Sorry, a bit offtopic but useful anyway.
Tried the answer given by Tough Coder in Windows 7 and it works!
Create a shortcut to cmd.exe in %HOMEDRIVE%%HOMEPATH%\Links, open its file properties and change the field 'Start at' to %1 ('Iniciar en' translated from spanish).
Now drag folders to it and you'll see the magic. It works too in all standard Open File dialogs. wow!
ps: those 'strange' tabs above in my picture are because I use Clover. I recommend it!
Use the following in command prompt to open your current location in windows explorer:
C:\your-directory> explorer .