creating a directory on the server with lotusscript


How can I create a dir with lotusscript on the server, from a client, or isn't this possible.

Thank's a lot

Who is Participating?
CRAKConnect With a Mentor Commented:
What are you trying to store in that dir? A database?
In that case, use:
NotesDatabase.CreateCopy(Server, Path)
NotesDatabase.CreateReplica(Server, Path)

Just like it happens when you do so through the File-menu, any non-existing dir's should be created automatically.
* not tested *
you can use MkDir in LotusScript
Here's an example
MkDir "c:\paul"
Create directory paul, in the root directory of drive C.

ps : but be carefull, if you run the agent or so, from the server, he create's the directory on the c drive from the server and not your local c drive
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

pvandelouwAuthor Commented:
OK I have read about de MkDir function, but the agent is run locally, and i want to create a directory on the server in his data directory. Is this possible or do i have to move the database to the server.

for example.



on this server i want to create the directory, "test" How can i do this.

greetingz Paul
I don't think that's possible.
The easiest way is to copy the database to the server.
You can try to make a directory on the server, but if you want to make a directory on one of the local drives from the server, it isn't possible, if you're working local.
if you want to make a directory on the server, try this

But, if your server is running on NT as a service under the 'system' account then it wont be able to 'see' network resources (even if you can see them when you log on).

Apparently it is a deliberate security restriction to disallow any 'system' services network access.

The work arround is to go into the services section and tell the Domino service to run under a user id.
If you're working under nt, you can try to map the c drive from the server, and call it the P drive are something like that.
mkdir "p:\test"
you have to make it a bit more error proof than that. you can use something like this:

     On Error Goto errorDir    
     Call emAtt.ExtractFile( path$  & fileName$)    

     On Error Goto errorHandling

     Exit Sub
     Print "Attachment.CreateAttachment reports:"
     Print Cstr(Err) & " " & Error$
     Resume Next
     Print "Attachment.CreateAttachment reports fatal error:"
     Print Cstr(Err) & " " & Error$
     Exit Sub
errorDir:' <- called if extract file fails
     On Error Goto errorMkDir
     Print "Error when extracting file: " & fileName$ & " to directory: " & path$
     Print "Creating new directory: " & path$
     Mkdir path$
     On Error Goto errorFatal
     Call emAtt.ExtractFile( path$  & fileName$) '<- try to extract again
     Resume Next
errorMkDir: <- called it MkDir fails
     Msgbox "Unable to create directory: " & path$ & Chr(10) & "Please make sure this directory does not exist and" &_
     Chr(10) & "that the disk is not full.  If the problem continues, try changing the directory to D:\.  You must exit Notes" &_
     "for changes to take effect.", MB_ICONIFORMATION, msgTitleError$
     Exit Sub
End Sub
pvandelouwAuthor Commented:
thanks alot. I creates i directory just as simple as that.

greetingz Paul
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.