Link to home
Start Free TrialLog in
Avatar of rupak_khurana
rupak_khurana

asked on

How to Map Network Drives ........

thru software as we do in the Explorer ?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ooops, correction - the above code is partly UNICODE, use


    nr.dwType           =   RESOURCETYPE_DISK;
    nr.lpLocalName      =   ""; // use a drive letter like "L:" to map it to a local drive
    nr.lpRemoteName     =   "\\\\server\\share";

instead - sorry...
One other thing that I forgot - you'll have to link with 'mpr.lib'
Avatar of rupak_khurana
rupak_khurana

ASKER

I tried connecting and disconnecting too. Works pretty fine...Thanks a lot