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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetFile leads to non responding IIS while file exists

Status
Not open for further replies.

PaulEijkman

Technical User
Feb 17, 2004
4
0
0
NL
I have a problem with GetFile. When I run the code below on IIS ( XP pro ) It will not respond nor generate an error message even when the file ABCtest.txt exists. If I omit the GetFile line and the following line the codes works fine and reports a path and existing file. Guess I am missing something .... Can you help me here ?

Paul.

Code:

Set objFSO = Server.CreateObject ("Scripting.FileSystemObject")

strFilespec2rel = Server.MapPath("ABCtest.txt")
Response.Write strFilespec2rel &&quot;</br>&quot;
Response.Write &quot;err1&quot; & VbCRLF & Err.Description & &quot;</br>&quot;


If (objFSO.FileExists(strFilespec2rel)) Then
strMsg = strFilespec2rel & &quot; exists!!.&quot;
Else
strMsg = strFilespec2rel & &quot; doesn't exist.&quot;
End If
Response.Write strMsg & &quot;</br>&quot;
Response.Write &quot;err2&quot; & VbCRLF & Err.Description & &quot;</br>&quot;

Set myFile = objFSO.GetFile(strFilespec2rel)
strDate= myFile.DateCreated
Response.Write strDate &&quot;</br>&quot;
Response.Write &quot;err3&quot; & VbCRLF & Err.Description & &quot;</br>&quot;

Set objFSO = Nothing


 
Perhaps best replies in Forum333 (Microsoft: Active Server Pages (ASP))

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
After a lot of hours this newbee found out why IIS was silence ( no error messages ) while trying to run a simple script.

The Anti-Virus program ( I use Norton ) on the station where IIS is running causes this phenomenon. After switching the script-blockage off all scripts work fine.

It still surprises me:
1. There is no error message saying: unable to run scripts.
2. The AV software permits the use of FileExists but not the use of GetFile.

Nevertheless Case closed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top