Archive for August, 2012

Substitute paths as virtual drives on Windows

With the subst command you can associate a path with a drive letter.

subst [drive1: [drive2:]path]
  • drive1:               Specifies a virtual drive you want to assign a path.
  • [drive2:]path     Specifies a physical drive and path you want to assign to a virtual drive.

Create new virtual drive

subst Z: "C:\Documents and Settings\All Users\Shared Documents"

Display a list of current virtual drives


Delete a substituted (virtual) drive

subst Z: /d

Persistent Substituted Drives

Drive letters mapped in this way are not available during system startup for services nor do they persist across a reboot. To use persistent mapping you have to create a new registry entry or you can use psubst:

Categories: Windows XP

Edit Windows hosts (file)

For Windows NT, 2000 and above


Registry key under \HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts

Categories: Windows 7, Windows XP

Minimal Maven POM file

Minimum requirements for a POM:

  • project root
  • modelVersion – should be set to 4.0.0
  • groupId – the id of the project’s group.
  • artifactId – the id of the artifact (project)
  • version – the version of the artifact under the specified group

Create a symlink / hard links with Windows 2000 and above


Download and install Windows Server 2003 Resource Kit Tools:

Create a symlink

linkd "c:\newdir" "c:\existingdir"

Check symlink

dir /al

Remove symlink

linkd "c:\newdir" /d


Download junction:

Place the junction.exe file e.g. in your C:\WINDOWS\system32 directory so it would be on your system path.

Create a symlink

junction "c:\newdir" "c:\existingdir"

Check symlink

dir /al

Remove symlink

junction "c:\newdir" /d


Only the junction tool knows that these folders are actually symbolic links, the rest of the Windows file system thinks they are normal folders. For example you can delete a junction via Explorer and it will moved to your recycle bin and the folder that it points to stays where it was. But if you then empty your recycle bin it also empties the contents of the folder that this junction was pointing to! So always remember to use the junction command to create & delete junctions.

Junction Link Magic

Download Junction Link Magic:

Version 1 for Windows 2000/XP

Version 2 for Windows 2003/Vista/7

Junction Link Magic is a utility that lets you create junction points. Junction Link Magic automatically lists existing junction points, and it offers an easy interface to add, modify or remove junction points. Junction points can only be created on volumes formatted with NTFS 5.0 or higher.

Link Shell Extension

Link Shell Extension (LSE) provides for the creation of Hardlinks , Junctions , Volume Mountpoints , and Windows7’s Symbolic Links, (herein referred to collectively as Links) a folder cloning process that utilises Hardlinks or Symbolic Links and a copy process taking care of Junctions, Symbolic Links, and Hardlinks.

Categories: Windows 7, Windows XP

Copy and rename a file with Maven Antrun Plugin

<project xmlns="" xmlns:xsi=""


							<target name="copy and rename file">
								<copy file="mySourceFile" tofile="MyDestFile" />

mvn validate