in reply to Connecting to network shared drive

Assuming you are working on *nix, you could use smbclient. There is also a perl api, with many examples.