I am trying to code a program about copying files from domino doc to local hardware. It pups up “path not found” when calling “mkdir”. I am sure the path parameter of mkdir is correct and the root path is granted full control to everyone.Any advice would be appreciated.
Subject: About mkdir error
Are you creating a new directory directly in the root path, or are you trying to create a whole hierarchy with a single command? If you are trying to create “C:\UserFiles\Excel\Sales” and “C:\UserFiles\Excel” doesn’t already exist, you need to create it first.
Subject: RE: About mkdir error
Here is a nice bit of code that will do the thing that Stan mentioned.
the “s” in (s As String), is the path you want to create. example pass this to the sub …
call EnsureSubDir(“C:\program files\Lotus\Notes\Data\test\apps\oh no\how deep will this go\time to go home\not yet”)
Sub EnsureSubDir(s As String)
Dim p1 As Variant
On Error Goto MkDirErr
If Right(s, 1) <> "\" Then s = s + "\"
p1 = 0
While Not p1 >= Len(s)
p1 = Instr(p1 + 1, s, "\")
If p1 = 0 Then p1 = Len(s) + 1
Mkdir Left(s, p1)
Wend
Exit Sub
MkDirErr:
Resume Next
End Sub
p.s … please don’t use my example path, but you can if you like to test.
Please note that if you are trying to write to a mapped drive, you need to have access to that mapped drive.
Also, if you are using this in a scheduled agent on the server, you need to have restricted access so you can write to the server’s OS. That’s set in the server doc and the agent properties.
Further, if the server agent is going to write to a mapped drive, the account with starts the Domino service on the OS will need to have rights to that mapped drive. In my experience, it’s a Local Account, which most network admins will not give access. It depends, I just want to mention.
hope this helps
Subject: RE: About mkdir error
Thanks you so much,Xie Xie.It really helps a lot ~
Subject: RE: About mkdir error
anytime, it hope it makes a difference in your day!
Subject: About mkdir error
post your full code