How to use registry to set shortcut keys in Windows? - windows

I want use registry to set shortcut keys in Windows.
For example,I should open cmd when I press Win+T.
But I won't set it.
Thanks for dalao

Related

Registry location for cmd

I've been looking through the internet trying to find the location of the command prompt in the registry, as I want to see if there is a way to enlarge the text using the registry, and generally having a look through it's settings within the registry, however I can't find the location on the internet, or on my own looking through the registry, can anyone tell me the following:
Where is the command prompt in the registry?
Is there a way to edit a shortcut's properties within the command line?
Either of these may solve my quest to alter the text automatically, rather than have to set up the shortcut of a bat file every time I make one
Thanks!
HKEY_CURRENT_USER\Console
and
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
The Console key can have custom setting for different .exe files.

Windows RegEdit hides and protects entries

I'd like to reset a file association, created using the "Open With" dialog.
I am on Windows 7 ULT.
I have associated *.part files with VLC.exe an I can see that this association is accomplished by a special "UserChoice" entry under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.part.
However I can only see this by a special registry search tool that browses the registry keys and values using the Win32 API. I can not see the entry in the "Windows Registry Editor" aka RegEdit.
Regedit indirectly knows this key, because if I try an create a new reg key with the path HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.part RegEdit says that the key .part already exists (which is true).
Also I can delete this key using the cmdline tool reg.exe by:
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.part" /f /va
If the key wouldn't exist reg.exe would print out an err msg.
Anyhow the key isn't really actually deleted because I can repeat the command over and over again which indicates that the key is still there. Also in Windows Explorer if I select a *.part file and check the file association it says it's still associated with VLC.exe. So it seems to be recretaed immediately anytime i gtes deleted, which indicates a protection mechanism.
So the simple questions is:
How can I really delete this Registry entry and how can I reset this file association?
And, optionally, how can I make RegEdit display it?
I do not want to change it using the "Open With" dialog, because it would create yet another UserChoice entry under ...FileExt.part
But my goal is to add multiple Commands to .part files that I can select with the right click context menu.
This used to work by simply associating the extension with a progid and adding the commands you want to the ProgId's Shell subkey.
Any one any clues?
For what it's worth...
I finally found the reason why the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.part was not displayed in my local RegEdit install.
And why I thus could not modify / delete it using RegEdit.
For whatever reason in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\ I had reg sub keys with square brackets in their name, like: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.02]
Since RegEdit seems to use this character as a meta character to denote the end of a key name, it didn't seem to have managed displaying all subsequent subkeys properly. It only showed those that alphabetically came before the first key with a ']' in its name.
I realized this by exporting the whole FileExt key into a reg file.
And I also could remove these junk entries with a reg file.
As for how to delete reg entries using reg files see: How to delete registry subkeys using a .reg file
So now I finally could add the additional entries to the part_auto_file key
and the show up in the context menu and even execute. Cheerio. 🤣

Assign VBS Script to a Keyboard Shortcut

I have a very basic VBS script that I plan on using frequently on my Windows 7 machine. Is there any way I can bind it to a keyboard shortcut so I don't have to navigate to it through Explorer obnoxiously.
I realize this question does not directly pertain to programming, or even scripting for that matter, but I could not find a straight answer online or through my own experimentation. I'm sure that there is a simple solution somewhere...
Thank you for taking the time to read, and hopefully respond to my inquiry.
Evin Ugur.
Windows does have built-in support for shell shortcut keys, where a keypress is used to invoke an *.lnk file that launches your VBScript (using either cscript or wscript).
Create a shortcut file, have it invoke your VBScript file directly or run cscript or wscript with the appropriate arguments, then save it and open its Properties sheet and set a keystroke in the "Shortcut key" field (I suggest something like Ctrl+Alt+K).
Like so:
Then, whenever you press Ctrl+Alt+K, regardless of the active application, your script will be invoked.
A more heavy-duty alternative is AutoHotKey: http://www.autohotkey.com/
Just as an FYI.
I tried this and I was not able to register the hotkey when I had the Icon in a costume folder. Even if I added the hotkey, it failed to work.
Once I moved the icon to the "C:\ProgramData\Microsoft\Windows\Start Menu\Programs", the hotkey started to work.

Script to remove hotkey for internet-shortcut in windows

Everytime I start my computer the login-scripts create a shortcut in the start menu which also defines a hotkey for it. Unfortunately this hotkey collides with one of the default eclipse hotkeys so every morning I manually remove the hotkey from the shortcut.
Deleting or manipulating the shortcut doesn't remove the hotkey as well.
So how can the hotkey be removed with a script?
To be precise the shortcut is a shortcut to an URL. The file has the suffix .url.
The structure of the file seems to be an basic windows info file:
[InternetShortCut]
URL=http://...
...
Hotkey=1620
...
I am using Windows XP.
maybe some tweaking on the msconfig's startup and services tab can do some help

Assigning a shortcut to open cmd here

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"

Resources