Creating windows links on Linux?

I'm running a SAMBA file store for our Windows users, and I'd like to automatically generate windows LNK files linking to other network shares that the user needs access to.

I've done quite a bit of googling and I can't find a way of creating windows links on Linux, or through Perl. I did find a perl module that looked promising in CPAN, but it will only run on Windows unfortunately.

If it's not possible to create .LNK files, perhaps there is an alternative solution people can suggest to allow the users to click on a file in one SAMBA store to be linked to a different SAMBA share?

Thanks,

Bart.


Solution 1:

The binary file format is documented here: https://web.archive.org/web/20110817051855/http://www.stdlib.com/art6-Shortcut-File-Format-lnk.html It looks like you should be able to generate files like that using whatever language you want to output. I don't have a windows system handy to try out if its correct or not.

Solution 2:

It's been a long time since the initial question, but I've had the same issue and found a solution.

I wrote an application whose goal is to allow anyone to create lnk files from any OS. I started writting it in bash and then I converted it in C (the sources are available).

It's still fresh, so except me nobody tested yet, but you can have a look here :
  http://www.mamachine.org/mslink/index.en.html