History in Windows CMD window

I wanted a good history function in my command window. Including remembering between sessions. Clink can do this (and a lot more!) — and can be installed without admin.

Adding clink

First, I grabbed the zip from https://chrisant996.github.io/clink/ and unzipped it into…

C:\Users\username\installs\clink

Taskbar

What I want is to launch from taskbar. I go to this folder in Explorer and right-click on clink.bat and make a shortcut.

Then I right-click on shortcut and go to Properties. I have to change the target and the starting folder:

Target:   C:\Windows\System32\cmd.exe /C "C:\Users\username\installs\clink\clink.bat"

Start in: C:\Users\username\

I can also change the icon and choose one of the Clink icons.

Then I can drag the shortcut to my takbar, ready for launch.

Now — a trick

Immediately after making the shortcut, you have:

Target: C:\Users\username\installs\clink\clink.bat

Start in: C:\Users\username\installs\clink

But you cannot drag the shortcut onto the taskbar until you modify it to have CMD.EXE launch Clink, as above. This is a bit of Windows arcana, and is very odd in this case because you are using CMD to launch a program than is itself a kind of wrapper around CMD – the clink.bat file contains this line:

start "Clink" cmd.exe /s /k ""%~dpnx0" inject %clink_profile_arg%%clink_quiet_arg%"

So you are using CMD to launch Clink to launch CMD. But it allows Clink to be launched from  the taskbar, which is what I wanted.

Author: Darren

I'm a scientist by training, currently working as a writer, trainer and editor.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.