Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create dirs and folders on a remote server

Status
Not open for further replies.

wraheem

MIS
Jul 19, 2001
62
US
I am new to VB .NET and I am trying to create directories and files on a remote server as part of an upgrade of a user creation script I created in PERL. I have the user creation part but we also create folders on a remote server, copy files from another remote server, and place the proper permissions on these files and folders. After 2 days of googling and searching this FAQ and forum all I have found is creating folders on a local machine.

I know this can be done somehow (without sockets)and I would appreciate some simple code or a link as an example.

Thank in advance :)
 
First, you would need, at least read/write permissions on the remote server. Second, map a drive to the server and finally in your code create a folder/file to the drive that you mapped.

Take a look at basic file i/o in the on-line vb .net help. It's fairly good at showing how to create directories and files locally and to a share.
 
Thanks pweegar.

I've seen plenty on mapping drives but I was hoping that I wouldn't need to do that.

But if that is how I have to do it...

Thanks again.
 
Not nearly that bad:

Code:
Dim folder As System.IO.Directory
If Not folder.Exists("\\madison\home\rway\test") Then
  folder.CreateDirectory("\\madison\home\rway\test")
End If

just replace the "\\madison\home\rway\test" with the server and path you want.

-Rick

----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top