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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How create folder on remote server ?

Status
Not open for further replies.

hervebin

IS-IT--Management
Feb 21, 2002
35
FR
Hello

I try to create a folder on a remote server.
My problem is to use another credential in the program.

Who have an idea ?

RV
 
Take a look into the CreateFolder method of the FileSystem Object

Code:
Dim oFS       As Object
Dim oFolder   As Object
Dim sPath     As String

sPath = "Path\to\remote\server\and\new\folder\name"

Set oFS = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFS.CreateFolder(sPath)

Everybody body is somebodys Nutter.
 
What do you mean "use another credential in the program"? Are you wanting to have a user that isn't authorized to create folders on a network share create them? If this is the case, I'd recommend another path. If the user doesn't have read/write access to that directory, then they aren't going to be able to run anything there once the directory is created.

If however this is some type of a program that will run as a service and needs to access a folder that the normal user can't see, then you should probably look at setting up a password protected database on a share with the user information encrypted into the registry or something like that.
 
Hello.

Thanks ClulessChris, but it is not my problem.
To create a folder on a network share, when you have the right to write, there is no problem.

macleod1021,

I would like to use another credentials.
Like when you use OpenDSObject, when you want to bind the Active Directory, with an admin account.
(ex: OpenDSObject(strADsPath, strUserName, strPassword, 0)
)

I can't find a method to create a folder ... (CreateFolder, CreateDirectory, WMI... ) nothing works!!!!
You can create a share, but only when the folder exists !!!

Is it more clear ?

I have a solution, I launch my program with a RUNAS command... but anyone who has a admin account can execute my program. I can't check who execute this.

RV

PS: Sorry, I french, and my english is not very good!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top