problem using FileSystemObject
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > problem using FileSystemObject




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    problem using FileSystemObject  
gadya


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-04 10:58 PM

I am learning to use ASP on IIS 6 under Windows XP.
When I came to the FileSystemObject I found IIS hangs on OpenTextFile.
(no problem when scripting on the Client!)
I couldn't find anything on Technet.

I find that I can use folderExists
but not getFolder

I can use GetFileName
but not GetFile
and not OpenTextFile

(I've tried using Fat32 and NTFS and different drive letters but to no avail
.
I've turned off Norton antivirus and set my IE security settings to Low.)

I'm using the Script Debugger and executing one command at a time and it
hangs consistently on binding to a file.
I then have to reboot my PC in order to be able to use IIS.
------------------------

This works:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Stop
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If fso.FolderExists("H:\Downloads") then
Response.Write("<br>There is a folder named \Downloads")
End if

fln = fso.GetFileName("H:\Downloads\test.txt")
Response.Write(fln & "<br>")

</SCRIPT>

(The Stop is to activate the Debugger)
---------------------------------------

These don't work
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Stop
Set fso = Server.CreateObject("Scripting.FileSystemObject")
If fso.FolderExists("H:\Downloads") then
Response.Write("<br>There is a folder named \Downloads")
set objFolder = fso.getFolder ("H:\Downloads")
' fails here
Response.Write("<br>Have bound to folder named \Downloads")
End if
</SCRIPT>

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Stop
Set fso = Server.CreateObject("Scripting.FileSystemObject")

fln = fso.GetFileName("H:\Downloads\test.txt")
Response.Write(fln & "<br>")

set objFile =  fso.GetFile ("H:\Downloads\test.txt")

' fails here
Response.Write("<br>Have bound to file named test.txt")

</SCRIPT>
--------------------------------

Any ideas?


Victor







[ Post a follow-up to this message ]



    Re: problem using FileSystemObject  
Aaron [SQL Server MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-04 10:58 PM

http://www.aspfaq.com/2180

--
http://www.aspfaq.com/
(Reverse address to reply.)




"gadya" <gadya@discussions.microsoft.com> wrote in message
news:9F751265-4FAE-4416-B574-10D875AC3775@microsoft.com...
> I am learning to use ASP on IIS 6 under Windows XP.
> When I came to the FileSystemObject I found IIS hangs on OpenTextFile.
> (no problem when scripting on the Client!)
> I couldn't find anything on Technet.
>
> I find that I can use folderExists
>  but not getFolder
>
> I can use GetFileName
>  but not GetFile
>  and not OpenTextFile
>
> (I've tried using Fat32 and NTFS and different drive letters but to no
avail.
> I've turned off Norton antivirus and set my IE security settings to Low.)
>
> I'm using the Script Debugger and executing one command at a time and it
> hangs consistently on binding to a file.
> I then have to reboot my PC in order to be able to use IIS.
> ------------------------
>
> This works:
> <SCRIPT LANGUAGE=VBScript RUNAT=Server>
>      Stop
>      Set fso = Server.CreateObject("Scripting.FileSystemObject")
>   If fso.FolderExists("H:\Downloads") then
>   Response.Write("<br>There is a folder named \Downloads")
>   End if
>
>  fln = fso.GetFileName("H:\Downloads\test.txt")
>  Response.Write(fln & "<br>")
>
> </SCRIPT>
>
> (The Stop is to activate the Debugger)
> ---------------------------------------
>
> These don't work
> <SCRIPT LANGUAGE=VBScript RUNAT=Server>
>      Stop
>      Set fso = Server.CreateObject("Scripting.FileSystemObject")
>   If fso.FolderExists("H:\Downloads") then
>   Response.Write("<br>There is a folder named \Downloads")
>         set objFolder = fso.getFolder ("H:\Downloads")
> ' fails here
> Response.Write("<br>Have bound to folder named \Downloads")
>   End if
> </SCRIPT>
>
> <SCRIPT LANGUAGE=VBScript RUNAT=Server>
>      Stop
>      Set fso = Server.CreateObject("Scripting.FileSystemObject")
>
>      fln = fso.GetFileName("H:\Downloads\test.txt")
>      Response.Write(fln & "<br>")
>
>      set objFile =  fso.GetFile ("H:\Downloads\test.txt")
>
> ' fails here
>      Response.Write("<br>Have bound to file named test.txt")
>
> </SCRIPT>
> --------------------------------
>
> Any ideas?
>
>
> Victor
>
>







[ Post a follow-up to this message ]



    Re: problem using FileSystemObject  
gadya


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-25-04 10:58 PM

Thanks AAron

"Aaron [SQL Server MVP]" wrote:

> http://www.aspfaq.com/2180
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "gadya" <gadya@discussions.microsoft.com> wrote in message
> news:9F751265-4FAE-4416-B574-10D875AC3775@microsoft.com... 
> avail. 
>
>
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:40 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register