$dir()

Ok here is my issue. I have read several postings regarding the $Dir command and I have yet to come up with a solution. I have tried the session.sleep code but to no avail as well as other suggestions made in this forum.

In a discussion database the document have several attachments to them. I am trying to move the attachments to a shared file creating sub directories on the share file path based on the database document’s category and topic (NewsLetterSubject) fields. My issue is that I keep getting the Error 75: Path/file access error.

I ue the following code and if the path exists it errors out. If the path is not there I works until it loops and thinks that the path is not there which it is.

destPath = “\100.05.19.09\Risk\DominoRMDocuments”

set doc = vu.getfirstdocument

Do until doc Is Nothing

oldtopic = topic

If cat <> doc.categories(0) Then

  cat = doc.categories(0)

End If

DN$ = Dir$(destpath & "" & cat )

If DN$ = “” Then

   Mkdir(destpath & "\" & cat )

   ses.sleep (5000)

End If

'check if topic exists for top level doc

If doc.hasItem(“ImmediateParentSubject” ) Then 'response doc and need to add new topic folder

  topic = oldTopic & "\" & doc.ImmediateParentSubject(0)

Else

  topic = doc.NewsLetterSubject(0)

End If

'now make the directories

If Dir$(destpath & "" & cat & "" & topic) = “” Then

  Mkdir(destpath & "\" & cat & "\" & topic )

  ses.sleep (5000)

End If

'the code now copies the embedded ojects

  Set doc = vu.GetNextDocument(doc)

Loop

The code then proceeds to detatch the files and it works great for the first document. When the code loops to the second document, which is the same category, I get there error 75 message. The code

This is frustrating. When I call up a msgbox DN$ I get an empty string but there is a directory there.

Mike

Subject: $DIR()

Do not use the URI -path. Map a drive to the share and refer to the driveletter instead. There is a lot of security problems concerning the Dir-command and URI-paths.

Since Dir-command also is a restricted command: Make sure that the security settings of the agent is set to 2. Allow restricted operations" and that the signer of the agent is listed in the server documents field “Sign or run restriced LotusScript/Java agents”.

hth