I have spend months now trying to get the Visual Basic 2010 codes on how to map a network drive, disconnect them, and re-map network driver.
I will need to be able to map it to the profile folder to something like this:
Full path; “\10.10.10.12\Profile folder".
I need to log in to have access to the network folder /user:Domainname\UserName Password
,
then confirm if mapping was successful with a message.
After the mapping I will request the profile name and check if such profile folder exists on the network. If it exists, return a message stating that the profile exists, and delete the profile folder overwriting any folder property like if reading only, etc.
There are other tasks but his is where I am hit a dead end.
This question is old but maybe the OP is still looking. I wrote an HTA page awhile back to map a network address to a virtual drive. The code is VBScript and so uses the WScript library, which is not a native part of VB.net. See WScript in VB.Net on StackOverflow for more info on that.
The connect script:
Personally, I haven't found code to do the same thing in .Net. The VBScript shown above is pretty primitive; I hope it plus the info on binding WScript gives you an idea or two, though.
Edit: see Eric Dalnas' code, here