Software and scripts for Windows

On this page, I keep a collection of useful scripts and programs that I have created for the Windows operating system, all of which are freely available for download and released under the MIT license.

Name Links
Short description
drm.exe
documentationindexdownload
Easily switch screen resolutions via tray icon, while retaining the relative positions and sizes of all windows.
watch.cmd
documentation, index, download Stream the specified YouTube video in MPC-HC. Always uses the highest available quality. Requires youtube-dl, jq, MPC-HC.
c.exe
documentationindexdownload Open the specified path in a new command prompt. Useful if run from the Run… dialog.

Snippets

Here is a collection of smaller scripts that I find useful. If you have JavaScript enabled, and use a relatively modern browser, you can click the download link below each code block to easily download the its contents. Otherwise, you can just copy the code yourself.

Convert copied file:// address to Windows path

This short command, which you can place in a shortcut, takes a path like file:///C:/Documents%20and%20Settings from the clipboard and replaces it with a proper Windows path – i.e., C:\Documents and Settings. Requires Windows Script Host 5.7.

mshta "javascript:clipboardData.setData('text',decodeURI(clipboardData.getData('text')).replace('file:///','').replace(/\//g,'\\'));close()"

Read copied text aloud

This command reads the clipboard aloud, character by character. I find it very useful when copying numbers by hand from paper to the computer. Requires Windows Script Host 5.7.

mshta "javascript:new ActiveXObject('SAPI.SpVoice').speak(clipboardData.getData('text').replace(/(.)/g,'$1 '));close()"

Alt code entry without number pad

This AutoHotKey binding (triggered by Alt + z) opens an input box where the user can enter alt codes, which will then be simulated as though they were entered using a number pad. Additionally, as long as the input box is open, it makes m, j, k, l, u, i (and 7, 8, 9) simulate a number pad, which is useful for keyboards without number pads, such as laptop keyboards. Requires AutoHotKey.

!z::
ToggleAltMode()
InputBox, AltCode, Enter alt code,,, 150, 90, Locale
ToggleAltMode()
IfEqual, AltCode,, return
Send, {LAlt down}
Loop, PARSE, AltCode
{
X := A_LoopField
Send, % "{Numpad" . SubStr(X, 0) . "}"
}
Send, {LAlt up}
return

$m::SendInput, 0
$j::SendInput, 1
$k::SendInput, 2
$l::SendInput, 3
$u::SendInput, 4
$i::SendInput, 5
$o::SendInput, 6

ToggleAltMode()
{
Hotkey, $m, Toggle
Hotkey, $j, Toggle
Hotkey, $k, Toggle
Hotkey, $l, Toggle
Hotkey, $u, Toggle
Hotkey, $i, Toggle
Hotkey, $o, Toggle
}