By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,682 Members | 1,080 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,682 IT Pros & Developers. It's quick & easy.

ASP File Object "Permission Denied"

P: 5
This file is suppose to display "Welcome to the Zone!" and also write it to a text file instead i get an runtime error 0x800A0046 Permission Denied
The Script:

<html>
<title>File Object</title>
<body>
<hr>
<%
set TestFile=Server.CreateObject("Scripting.FileSystem Object")
TFileStream=TestFile.CreateTextFile("c:\inetpub\ww wroot\ABG_ASP\TestFile.txt")
TFileStream.WriteLine "Welcome to the Zone!"
TFileStream.Close
%>
</body>
</html>
Nov 9 '06 #1
Share this Question
Share on Google+
4 Replies


sashi
Expert 100+
P: 1,754
This file is suppose to display "Welcome to the Zone!" and also write it to a text file instead i get an runtime error 0x800A0046 Permission Denied
The Script:

<html>
<title>File Object</title>
<body>
<hr>
<%
set TestFile=Server.CreateObject("Scripting.FileSystem Object")
TFileStream=TestFile.CreateTextFile("c:\inetpub\ww wroot\ABG_ASP\TestFile.txt")
TFileStream.WriteLine "Welcome to the Zone!"
TFileStream.Close
%>
</body>
</html>
Hi there,

Please enable the script execute exclusive permission under the IIS property section. Good luck & take care.
Nov 10 '06 #2

P: 5
Hey Sashi
Where do I go to enable the script execute exclusive permission under the IIS property section. Did not find it under the windows components IIS wizard.

Instruction Please
Nov 10 '06 #3

P: 3
Let me see if I can help with your problem, sometimes the problem is in the users account of your pc, some access to that file maybe disabled.

1st right click your folder where the files reside, then click properties.
If you don't see the "Security tab", follow the instructons below:

Open any "My Computer",
Click "Tools" in the menu,
Click "Folder Options..."
Click "View Tab"
Scroll down until you see "Use Simple File Sharing(Recommended)"
Uncheck "Use Simple File Sharing(Recommended)"
Apply
then Ok
---
right click your folder where the files reside again,
then click properties.
"Security tab" should now be enable

Just check all for the account user that you uses to run the program
Your program should work fine now :)
Nov 11 '06 #4

P: 5
Thanx that provided some progress.
Thats good, but when I run it, it creates the file TestFile ine the specified folder but it comes up empty in the folder and also produces this error on the page.

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'TFileStream'
/ABG_ASP/firstfile.asp, line 8

Again the script is:

<html>
<title>Working with the File Object</title>
<body>
<b>This is a first example of working with the File object!</b>
<hr>
<%
set TestFile=Server.CreateObject("Scripting.FileSystem Object")
TFileStream=TestFile.CreateTextFile("c:\inetpub\ww wroot\ABG_ASP\TestFile.txt")
TFileStream.WriteLine "Welcome to the File Object in ASP!"
TFileStream.Close
%>
</body>
</html>
Nov 12 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.