Link to home
Start Free TrialLog in
Avatar of ob1_
ob1_

asked on

Getting permission denied error when writing to TXT file in ASP

I am trying to execute the code below from a web page on an IIS server to record the responses that a user enters into the page.

I get an error "800a0046" which when I Googled says permission denied.

At this point I am running this from localhost as an admin on the box. I have tried writing to C:\ and C:\inetpub\wwwroot. Any ideas?


thanks,
ob1
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject") 
set f=fs.CreateTextFile("c:\inetpub\wwwroot\test.txt",true)
f.write("Hello World!")
f.write("How are you today?")
f.close
set f=nothing
set fs=nothing

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of jtlowe22
jtlowe22

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ob1_
ob1_

ASKER

i gave permissions to IUSR and IUSRS group and used "GetFolder" method to specify folder as well as text file. this seems to work.