Signiant Support

Tips for using net use for windows drive mapping in workflow components Print


NOTE: The recommended approach for accessing CIFS shares is to use UNC paths.  If you must use drive mappings however, this is the best practices.

Based on this MS KB article that indicates that windows mapped drives are not removed until the machine is rebooted, it is clear that the drive MUST be un-mapped after the data transfer has completed

http://support.microsoft.com/default.aspx?scid=KB;en-us;q130668 

What you therefore must do is make sure that the drive is deleted after you are done the transfers. The source and target agent finalize commands will run on the appropriate agent after the transfer is complete, whether it was successful or not, and can be used to unmap the drive.

For example:

Have a component where the target directory is a network mount (J:\ for example)

In the target initialization command, map the drive:

net use J: \\server\\share /user:username password

In the target agent finalizecommand, unmap the drive:

net use J: /d /y

Note that the /y flag must be present or the drive will not be unmapped. Now, it's also recommended unmapping the drive in the target error command just in case any errors occur in the transfer or the drive won't be available for the next template execution.