Embed file in form in notes client

I want to embed a file (user.bat) in a form so that the file is available to all users to detach via script but I can’t seem to get a handle to the file. In the Form in designer I can do Create > Attachment… and attach the file, when I compose a doc in the notes client I can see the file but I cannot find a way to get a handle to it. The HasEmbedded property is always false even after a forced save. GetAttachement does not work either.

What I’m trying to do is embed the batch file in the form so it can be detached to the user’s PC so I can Shell out to it via LS and run it. This form is going to be in forms.ntf.

Subject: embed file in form in notes client

I suspect this is in regards to your post yesterday regarding %userName% and domain.

Why not just create the .bat file on the fly? (i.e. open file for output, print# …), that way, you don’t need to deal with detaching / rich text stuff.

Just a thought.

Subject: RE: embed file in form in notes client

that’s a good idea, hadn’t thought of that, thx.

Subject: RE: embed file in form in notes client

Another approach would be to embed the file in an RTF on a profile document, and then use extractfile to write it to disk. I’ve used this successfully in the past.