VBScript for automatic creation of small textfiles on Web

  • Thread starter Thread starter Matthew Ferri
  • Start date Start date
M

Matthew Ferri

I'm using Windows 2000 SP4 with Office 2000 SP3 Frontpage to
write a small ASP routine that will create and delete
very small text files on the web.

I am using the routines I found on MSDN and Technet
for VBScript text file creation and deletion within ASP.

Everything works except for the CreateTextFile function.

Below is a sample fragment of one of many VBScript scripts
for file manipulation using ASP.

Dim objFSO, objCreatedFile, objOpenedFile
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objCreatedFile = objFSO.CreateTextFile("c:\TEMP.txt", True)
objCreatedFile.Close

Line number 4 always hangs my web page. It is the CreateTextFile
function that dies.

Is there another function or is there a known issue I am missing?

Everything else in my ASP code always works properly. This function is my
only problem.

Thank You in Advance.,
Matthew
 
Have you contacted your host to set the necessary permissions on the folder that you want the script
to function in?

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
I am currently still testing this procedure locally with http://localhost/
.... on my own local machine and I have full permission on the folder for the
creation of the file. It is the simple C:/temp.txt file name. I am
Administrator.

I have actually created the file in the folder and then just tried to delete
it with other VBScripts function as part of my trying to understand what is
happening. The deletion of
the file with the VBScript function also hangs my web page as well.

Thanks,
Matthew

Thomas A. Rowe said:
Have you contacted your host to set the necessary permissions on the
folder that you want the script
 
The folder must be within your web space and have IUSER_Machinename permissions.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Hi Matthew,
Open up Norton Anti Virus and disable script blocking - this "feature"
blocks asp from accessing the file system on your computer which is causing
a hang whenever you try to do anything with file system object. Once you've
done this you should be in business
 
Thank You Thomas and Jon

I implemented all three changes and that fixed it.

Thanks,
Matthew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top