Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hello,

I like to transfer a file to a windows shared network file. This file is not mounted in Windows Explorer, but can be opened on its commands line with \\server\..

I do not know how to set the directory variable to "\\server\.."

I tried

Directory.SetCurrentDirectory(CStr("\server\xyz"))


But this won't let me access to it, because it is on network.

I searched and I don't want a solution with a client sender and a second client receiver application. I'd like to solve it with vb.net functions.

I suppose, that I don't know all reference classes and I forgot one important to import, perhaps.

Thanks in advance!
Posted
Updated 5-Jan-14 23:32pm
v3

Try this (double \ at the start) :
VB
Directory.SetCurrentDirectory(CStr("\\server\xyz"))

You also need to have security permissions on the share and folder first so check that also.
 
Share this answer
 
Comments
deckelmouck 6-Jan-14 5:23am    
Thanks, I forgot to write, that I tried both. \ and \\
\ works fine for local folders but \\ or // doesn't work for shared or network folders :(

security permissions could be an issue.
Mehdi Gholam 6-Jan-14 5:36am    
Some network shares require authentication on the machine before accessing shared folders i.e. \\server first then \\server\xyz
 
Share this answer
 
Comments
phil.o 6-Jan-14 6:05am    
Reported as abusive: we don't care for your facebook profile.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900