Category Archives: Productivity Tips

Aliases for Windows and Clink

Here is how to set aliases for the Windows command window and Clink if you’re using Clink.

First, create a cmd file somewhere to create your aliases using the doskey command. Mine looks like this:

@echo off
doskey np=notepad++.exe $*
doskey ls=dir $*
doskey ns=nslookup $*
doskey ip=ipconfig $*
doskey hosts=notepad++.exe C:\Windows\System32\drivers\etc\hosts
doskey aliases=notepad++.exe C:\Applis\clink\aliases.cmd

You can also use all available cmd commands and variables to customize your shell, like title, color, set PROMPT, …

Then, open your registry and go to the following key:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor
and add add a string value named AutoRun and valued with the absolute path of your aliases file.

That’s it, from now on, all your aliases will be loaded every time you start cmd or clink.

Put any window on top

Depending on how many screens you have, sometimes it comes really handy to keep one window on top of the others without spending 30 seconds for something as simple as that.

That can be a simple console/PuTTY so you can keep track of something running or a notepad to copy-paste pieces of text without switching applications every time and so on.

To do this with a simple shortcut on Windows, I’m using AutoHotkey, which over time became vital for me and for my productivity 🙂

So this is as simple as that, edit your current script:

And add the following line to add a shortcut to keep any current window on top of the others:

^+SPACE::  Winset, Alwaysontop, , A

Of course you can change the shortcut, here I used Ctrl (^) + Shift (+) + Space.
Continue reading

Improved console for Windows

At some point I got tired of the Windows console (cmd). First, it is always in non-insert mode by default. I fixed this by checking the Insert mode in the properties, but still, no persistent history, no history search, bad auto completion, that was too much. So here is tip that could save you a lot of time when using command lines under Windows.

Project’s name is Clink. It gives you GNU read line power in cmd.exe. You can download the portable version (zip) and just unzip it somewhere.

Then, since it’s quite frequent to use the console, let’s pin it to the TaskBar. In the start menu, search for cmd, right click on it and pin it to the taskbar. Then right click on it while pressing shift and click Properties and add /c “full_path_to_clink.bat“.

clink_taskbar

Now when you clic on your pin that will open clink instead or the standard cmd.

Last but not least. Here is how to change the “Open command window here” when you’re doing right clic + shift on a folder, to open Clink.

clink_context_menu

To do this, edit the Windows register (Start menu, search regedit)

Open the key HKEY_CLASSES_ROOT\Directory\shell\cmd\command. Then edit the value to the following

cmd.exe /s /c "pushd "%V" & C:\Applis\clink\clink.bat"

Edit with the path to your clink.bat of course.

Now the Right-Clic + Shift > Open command window here should open Clink already located on the target folder.