You may consider to call system with subst as an argument
In reply to Re: Map Local Drive Win32 by ccn in thread Map Local Drive Win32 by briannz556