Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Saturday, July 4, 2020

Remap a Key to Work Around a Broken Keyboard Key on a Windows 10 PC


While you can use Microsoft's PowerToy's Keyboard Manager to remap a key, I advocate using AutoHotKey (AHK) instead. Why? It does the same thing and more. In additional to simulate pressing a broken key with another key or a set of keystrokes, you can for example press a key and have AHK type out a string of text (perhaps your email signature), or your favorite website's url, or even have AHK directly launch your url using a browser.

AHK website. On using AHK to remap key to work around broken keyboard.


In addition to remapping broken keys, you might also want to remap keys so all your laptops have a more consistent keyboard layout. I had a Samsung NC10 and the key locations are quite different from my Lenovo x61. Because of the difference and my constant use of both, I hit the wrong keys a lot. Remapping the keys of one laptop alleviates this problem.

How to set this up


But back to the more pressing problem of replacing a broken key, you will first need to install AHK. You can get AHK on their website at https://www.autohotkey.com. I have been using a very old 1.0.48.3 version (never saw the need to update), and the AHK website has a specific link to download this deprecated 1.0 version. Though I have not tested this with the newer version, I would think the newer version should work just as fine.

After you have installed AHK, write a script to specify the key remapping. One way to use AHK is to write a script, run it, and instruct AHK to constantly monitor your keypresses and act as directed. Here is one of my remap key scripts. To use it, you would save it as a text file (say using notepad) and save it with the .ahk suffix. I remap the end key to function like insert key, and the insert key to function like the end key -- because of the NC10 vs X61 issue I mentioned about. Note the first 3 lines are comments and is not necessary for the script to work. On the fourth line, all it tells AHK to do is if the "end" key is press, send the "insert" key instead.
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; Remap end and insert key for laptop
    ;; Note it is possible to remap via registry
    ;;   also: http://www.autohotkey.com/docs/misc/Remap.htm
    end::insert
    insert::end
If you want to run the script at Windows startup, you can create a shortcut with the following syntax, and put it in your Startup folder.
"C:\Programs\AutoHotkeyAutoHotkey.exe" "c:\bin\KeysRemap.ahk"
For Windows 10, the startup folder is located at the following location. Remember to replace "userName" with your own username. 
C:\Users\userName\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Some suggestions for what keys to use as replacement


There are surprising number of keys that I don't regularly, if ever, use. Some keys to consider: the menu key that usually located on the right side of the space bar (AppsKey), right alt (RAlt), caps lock (CapsLock), scroll lock (ScrollLock), or print screen (PrintScreen). Numpad keys might also work for you if you rarely use them. A more complete list of keys and their names is located here: https://www.autohotkey.com/docs/KeyList.htm

Concluding thought


As further advocation of using AHK, the program has a good community via its forum for support and you stand a good chance of finding help with your particular program and automations and shortcuts. I highly recommend giving it a try.

Sunday, December 8, 2019

Outlook 2007 IMAP Error 800CCC0E, Can't Connect to Hotmail


I can no longer connect to outlook.com (formerly hotmail.com) via IMAP and sync emails to Outlook 2007. I unfortunately haven't figure out a solution -- if there is one. I am noting the error here to help others confirm that yes, there's at least one other person in the world having this problem. As of now, I haven't find much mentioning of the issue online. The issue started a few weeks ago, so around mid November of 2019. When I try to get new emails, I get the following error:
Task 'XXX@hotmail.com: Folder:Inbox Check for new mail.' reported error (0x800CCC0E) : 'Outlook cannot download folder Inbox from the IMAP e-mail server for account XXX@hotmail.com. Error: Cannot connect to the server. If you continue to receive this message, contact your server administrator or Internet service provide (ISP).'
I rechecked the server and ports from the outlook.com help pages. I had used the IMAP server imap-mail.outlook.com before the connection problem, but changing it to outlook.office365.com doesn't help. SMTP doesn't work either.

My outlook android app works fine, so I suspect the IMAP-connection-related encryption got changed on the server side and so Outlook 2007 no longer works with outlook.com. I tried all the possible encryption options with port 993 -- auto, ssl, tls, none; all failed. I don't have newer desktop versions of Outlook, and from looking online the newer versions has something called STARTTLS as an encryption option. So newer versions of Outlook might continue to work just fine.


Tuesday, October 8, 2019

How to Resolve Issue with Windows 10 Crashing at 70% When Updating to Version 1903


After lots of trail/erroring, googling, and reading, this is the solution that worked for me and allowed me to update Windows 10 to version 1903.

Download the Media Creation tool. As of October of 2019, it can be downloaded via https://www.microsoft.com/en-us/software-download/windows10. This is the download associated with "Create Windows 10 installation media".

After the download, run the program. I am actually doing this for a Virtual Machine (Virtual Box), so I opt to create an ISO using the tool. After the ISO is created, I mount it and run the setup program associated with the ISO image. The prompts are relatively straightforward, and I just select the update option.

The program then just updates and reboots, and voila, I am upgraded to version 1903.

If I am doing this for a future update, I might need to download the tool again. The medial creation tool exe file seems to be associated specifically with version 1903. I.e., MediaCreationTool1903.exe.

Ref: https://answers.microsoft.com/en-us/windows/forum/all/cant-install-windows-1903-update/8b1fccf3-18f6-42c1-aeff-8add33c2f85d

Monday, September 2, 2019

How to Maybe Fix the "Task XML Contains a Value which is Incorrectly Formatted" Task Scheduler Errors


Thanks to a system restore on my Windows 8 machine to try fix some issues, I now end up with a host of new errors. Two sets of these errors are seeing the following messages when I start the Task Scheduler:

"Task microsoft compatibility appraiser: the task xml contains a value which is incorrectly formatted or out of range"
"Task license validation: the task xml contains a value which is incorrectly formatted or out of range."

After some googling, I find the following suggested fix (https://www.kapilarya.com/the-task-xml-contains-a-value-which-is-incorrectly-formatted-or-out-of-range-windows-10). I was able to get rid of the error messages after following the instruction, but my machine is still unstable and at least one of the continuing issues are related to the "Task license validation" tasks. So, use the following with care.

To eliminate the type of error messages noted above when starting the Task Manager, run regedt32 and go to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree

You should export/backup the relevant keys and back it up in case things go wrong and you have to restore them. Then, search for the name of the task that cause the error and delete the key.

Tuesday, June 25, 2019

Use handle.exe to Find Processes That are Locking Up Files


My automation script that downloads foreign exchange rates data and email myself the information is crapping out this past week. For whatever reason, my code to use perl to do inline edit is throwing an error about "Can't do inplace edit...."

After googling a bit, I find the following Sysinternals utilities that shows what processes might potentially be locking on the file: https://docs.microsoft.com/en-us/sysinternals/downloads/handle. I can see this being quite useful for other things as well, and therefore is making a note of it here.

Tuesday, May 21, 2019

How to Delete Misspelled Words added to the Dictionary via the Windows 10 OneNote App


The OneNote app uses Windows 10's native spell check, so any words accidentally added are stored in a text file at %APPDATA%/Microsoft/Spelling/. Since the added word is now considered correct, you can't auto-correct it anymore. So solve this, you can remove these words by editing the file default.dic. For me, it is stored in %APPDATA%/Microsoft/Spelling/en-US/.


To get to it via keyboard shortcuts, use Win+R to open the run prompt, and type in:
notepad %APPDATA%/Microsoft/Spelling/en-US/default.dic
There are three dictionary files in the en-US directory, and if you go up one level, you see this is the location WIndows stores dictionary files for all languages. So if you use other lanauges, you can look into the other folders.


Location of the Windows 10 dictionary folder.

Location of the Windows 10 dictionary file default.dic.




Reference: https://www.windowscentral.com/how-edit-custom-spell-check-dictionary-windows-10