Forum Moderators: open

Message Too Old, No Replies

Write to a file in a shared network folder

that is password protected?

         

weblamer2

7:45 pm on Dec 26, 2002 (gmt 0)

10+ Year Member



hi all,

This is really a visual basic question, but i thought I would go ahead and give it a shot...

I am opening a file on a shared network drive as so:

Open "\\Machine Name\SharedFolder\message.txt" For Append As #1

tis works just fine when there is no password on the folder. However, I need to password protect the shared folder, and i know the password, but how do i put that into the line of code so the program can snag it?

thanks...

Brett_Tabke

10:31 pm on Dec 30, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I looked through Google for a half hour trying to find the answer to this question because it was intriquing and I've wanted to do it before myself. I don't see how you can do that from a script - gotta be an easy way. Anyone?

RossWal

7:24 pm on Dec 31, 2002 (gmt 0)

10+ Year Member



If this is .Net, you could try using impersonation from the web config file... it allows you to impersonate a user and specify a password if needed.

Otherwise, depending upon your IIS settings for the page in question, it's likely running under the IIS_User NT account. Could you restrict access to the folder to only IIS_User instead of password protecting?

HTH,Ross