Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing File (Permission Denied Error) 1

Status
Not open for further replies.

jaredn

Programmer
Sep 1, 1999
1,506
US
The code in question is:
Code:
function createFile(path,txt)
{
	var fso,fil,srm;
	
	fso = new ActiveXObject("Scripting.FileSystemObject");
	fil = fso.CreateTextFile(path); //error here
	srm = fil.OpenAsTextStream(ForWriting,TristateFalse);
	srm.Write(txt);
	srm.Close();
}

The error states that "Permission Denied". Any ideas on how to circumvent this? I'm using a Windows 2000 server.
jared@eae.net -
 
ok i believe the problem stems actually from the folder permissions, to solve the problem, you will need to change the permissions on the folder that you are storing the file you need to change, to do this
locate the folder containing the file, and right click. choose properties, and then the security tab, in the list of users, their should be one labelled,
IUSER(blahblah) or something like that, if not add, it, you need to give this user write access to the folder, because when running scripts you are running as a normal internet user, so you need permissions with the iuser account.

hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top