Some useful scripts for windows.

Stoyan of has found the joy using javascript for scripting in the OS

I’ve put up a few scripts I find useful in windows (download at the end of the article):

  • addpath.js – Add a path to the registry path.
  • dt.cmd – Change to desktop folder.
  • e.cmd – Open explorer in current or specified folder.
  • regpath.js  – Output the path stored in the registry.
  • updateenvironment.js – Updates running apps with any changed settings in the registry.

And a couple that use python and pywin32:

  • – Copy the current working directory to the clipboard
  • – Copy the current path to the clipboard

All of have acompanying batch files to run them, I generally have everything in a folder c:\usr\cmd, but they should work from anywhere in the path.


Making Windows Usable – colourisation

Human beings are visual creatures, so in this post I’ll introduce some ways of making your life easier using colour.

Colour Your folders with iColorFolder

IColorFolder gives folders a context menu which lets you change the colour.  Unfortunately this doesn’t work fully in Vista yet, and you’ll need to manually change the icon, navigate to Program Files\iColorFolder\iColorFolder.dll to get access to the folder icons.

Incidentally if you want have a shortcut to a folder, you can use the same workaround to use a coloured icon.

Colourise your commandline

Colour ls

It’s equally useful to have colour folders when using the commandline, to achieve this you can use msls from utools.

Download it and place it somewhere within the path (I use \usr\bin, which I added to the path earlier).

Now, to get colour directories you can type “ls –color”.  However it would be better to have that happen all the time.

To set color as the default, set the environment variable LS_OPTIONS to –color:

  1. Press Windows+Pause,
  2. Click through these buttons: Advanced, Environment Variables, New
  3. Set the name as LS_OPTIONS and the variable to –color

Next time you launch the commandline and type ls, it will be in colour.  You can also combine options here, for instance if you want -l to be default as well.

Using 4NT/TCC-LE

Another way of getting colour directories is to use 4/NT or TakeCommand-LE (The free cut down version) from JPSoft.  This replaces the whole command shell and has many enhancements that help day-to-day.

Once you’ve downloaded the shell, if you want to change colours for particular kinds of files, then type option, go to the windows tab, and you can set directory colours.

To set EXE CMD and BAT files to be bright white enter:


If you want bright white on blue enter


Semicolons seperate file types – here I’ve set executables yellow and documents white:


The colours are arranged foreground, background and can be any of the ones used below (note background only has 8 colours to choose from, while foreground has 16, the last being the brighter versions).

Note:  These are the default textmode colours, if you change the command prompt colours yours may be different.

Tango in putty

The tango project is a usability project for free software, the colours are very pleasing and have been ported to putty, alternatively the Igvita theme is nice.

The tango port comes with the bitstream vera mono fonts too, so everything should look pretty good once installed.

Colourise your browser

If you use firefox you can install ColourfulTabs which makes it easier to find that tab among the crowd (especially useful if like me, you have lots open).

Colourise gmail (sometimes)

This one is a little annoying as it seems to be broken, but I’ll include it anyway in case it gets fixed.

If you install greasemonkey and the gmail colouriser, then all your gmail will be coloured by label (for instance I have a label for mailing lists I subscribe to).      When the gmail colouriser is working this works great for finding certain kinds of mail in the long list.

Unfortunately this isn’t working for me at the moment, so no screenshot… if I knew how to debug greasemonkey scripts I might have a look at fixing this as it’s so useful – it seems to choke on certain mail names but I’m not sure what they are.

JEdit with tango goodness

I’ve been using a patched version of JEdit with tango icons for a while, but seems like I missed the fact that 4.3 pre 14 came out with Tango support.

Go forth and download…


Tango is a project to bring tasty icons to open source projects, those on windows can also see tango icons in the current version of the gimp, in linux you can see them in gnome and kde.