Generating a relative path

I've been putting together a large server as a collection point for all my files. The server is running Open Indiana (formerly Open Solaris). In playing around with various methods of organizing things I've discovered that relative symbolic links on the server are properly processed on Windows. IOW, unlike Windows junctions, they work across the network and even across platforms. The downside to this is that the current best way I have to create these links is via the command line in a console window on the server.

I've found that using plink (part of the puTTY suite of utilities) I can from Windows run commands directly on the server. This should let me create commands in DOpus that will create the links on the server. The sticking point is that I have no idea how to generate a relative path to pass to the command. Ideally I'd like to determine the path to the source relative to the destination. (If destination is the current directory, what would be the relative path to the source?) Any hints on how I might do this fancy bit of directory path manipulation?

You'd probably need to pass both paths to an external script (e.g. VBScript) and have it work out the relative path. Opus can calculate relative paths internally but we don't have a code that you can use in commands to take two paths and output a relative one, at least right now.

BTW, Windows supports the same kind of symbolic links which work across platforms these days. (No use if you are using a non-Windows server, though.)

Creating so many links between directories on the server that you need to automate it sounds like a recipe for complications later on to me, FWIW.