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!

FileSystemObject Problem

Status
Not open for further replies.

frosty7700

Programmer
Aug 10, 2001
95
0
0
US
I am having problems using any FileSystemObject method on a particular server running NT 4. The code is as follows:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("c:\inetpub\
There is other code, but I have found through testing that the problem line is the one with GetFile. Basically, whenever the ASP file containing this code runs, there is a system beep from the server and IE just sits there appearing to be working, but in reality it is just hanging...I have to re-start IE before any pages will open again. This code was tested and worked flawlessly on a 2000 server...I thought maybe the permissions were bad on the NT server, and they were, but even after fixing them and re-checking them the problem remains. No error messages ever appear either. I have also found that this happens with ANY FileSystemObject method (CreateTextFile, etc.). Ideas needed, please!
 
Hello, frosty7700.

Should you not have the line set fso read as follows ?

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

regards - tsuji
 
Hello Frosty7700 - did tsuji's suggestion fix the problemo - I am having exactly the same issue (and I am using Server.createObject). The problem occurs on a single windows 2000 machine - the code is working fine on other windows 2000 machines and on a NT Box. Again I am having to restart IE to get anywhere with other pages.

Thanks for your help..

 
Sounds like you're running into an infinite loop, if you have to re-start IE. Does your PC itself crawl while the script is trying to execute? This is another sign of being caught in an infinite loop.

Here's the general syntax for using the FileSystemObject with the GetFile method:

Dim fso, f, s
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("c:\inetpub\
If it only happens with any FileSystemObject, it might be protected somehow. What specific error message(s) are you getting?
 
Some virus scanners will block access to files by scripting engines.

You mention the fact that the computers "beeps" which is highly unusual. It could also be that if your server does not have an antivirus package, that you have some weird virus that has infected the scripting object DLLs.

If you have a virus scanner, turn it off and see what happens. If you don't, then check the machine for viruses :)

Also, you should always use server.CreateObject rather than CreateObject in Active Server Pages. This makes sure resource allocation and cleanup happen properly in page scope. .
.. Eat, think and be merry .
... ....................... .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top