My ASP program with fso.opentextfile is working on Win2K but not working on Win2K3

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itskaps
    New Member
    • Sep 2007
    • 2

    My ASP program with fso.opentextfile is working on Win2K but not working on Win2K3

    Hi all,

    My following program code works fine on win 2K server but the same is not working on win2K3 server. It's showing error as page cannot be displayed. After debugging, I found that fso.opentextfil e is not working over win2k3. Can anybody pl. explain why it's not working and how to solve it?
    help reqd urgently pl.

    thx in advance.

    Code:
    SearchDatabase
    <SCRIPT LANGUAGE=JScript>
    
    var wsh = new ActiveXObject("WScript.Shell")
    wsh.Run("cmd /C dir *.txt > c:\\temp.txt", 0)
    
    </Script>
    
    <%@ LANGUAGE="VBSCRIPT"%>
    <%	
    	 strM = Getmyfile()
        function Getmyfile()
    	    Dim intRet,reqdString
    		 Set fso = createobject("scripting.filesystemobject")
    		 Set ts = fso.opentextfile("C:\temp.txt")
    		 reqdString = null
    		 Do While Not ts.AtEndOfStream
    		 data = ucase(trim(ts.readline))
    		 if instr(data,"database") Then
    		 reqdString = trim(split(data,":")(1))
    		 Exit Do
    		 End if
    		 loop
    		 ts.close
    		 Set ts = nothing
    		 Set fso = nothing
    		 Getmyfile = reqdString
        End function
        %>
        <HTML>
        <HEAD>
        <TITLE></TITLE>
        </HEAD>
        <BODY>
        <%Response.Write("Your databse is : " & reqdString)%>
        </BODY>
        </HTML>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </HEAD>
    <BODY>
    
    <P>&nbsp;</P>
    
    </BODY>
    </HTML>
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    I've never heard of this problem before, I have used openTextFile in several different versions of IIS. Perhaps the problem is that permissions aren't set right on one of your servers. Make sure the appropriate server settings are set in IIS and in windows, both for the folder and the file in question.

    Jared

    Comment

    Working...