
Mapping user home directory in VB on Win95
I would use
retvalue = shell("net use U: /HOME", vbHide)
NOTE: This will map the drive... vbHide means you will not see it run
however i recommend you make a shortcut in the c:\Windows directory called
NET this will be a pif file as all shortcuts are. Set its properties to
Net.exe and tick the close when finished checkbox... this is so that the
dosapp does not stay running!
Note Also: The drive you map is not "Persistent" that is it will not
automatically reappear each time you boot the system.
As an aside I map drives like this in my app in case they are not mapped
already on the system when my application runs. I want to unmap them when my
application closes but Net use U: /DELETE does not seem to work correctly.
Sometimes I see a red cross on the drive in Windows explorer but as soon as
I click on the drive the cross disappears and I am given access. Seems like
Windows 98 is too smart at repairing disconnected drives.
If anyone knows of a better way to Map / Unmap drives in vb then I am all
ears!
Quote:
> Hi,
> Can anyone tell me how to map a user's home share in VB on Win95.
> I know how to use the WnetConnection2 call to map drives normally, but
cant
> for the life of me work out how do the equivalent to the DOS command
> Net Use U: /home
> Cheers,
> Bob