Results 1 to 2 of 2

Thread: how to write textfile on client pc

  1. #1

    Thread Starter
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232

    how to write textfile on client pc

    I'm building some pages for intranet application. One of the action needed was to create a textfile and put it on the client PC.

    Security will be set to allows this (ActiveX run allowed for trusted sites and I have been using the wshShell object to launch some tool and it works....)

    Can I use 'Open file for output' -like statements to achieve this?

  2. #2
    Lively Member
    Join Date
    May 2001
    Location
    Falkenberg, Sweden
    Posts
    76
    One way is to use FSO (FileSystemObject), like this:
    Code:
    <SCRIPT LANGUAGE="VBScript">
    sub writeFile()
    	Dim fso, MyFile
    	Set fso = CreateObject("Scripting.FileSystemObject")
    	Set MyFile = fso.CreateTextFile("c:\file.txt", True)
    		MyFile.WriteLine("Hello world!")		
    	MyFile.Close
            set fso = nothing
    end sub
    </script>
    You can read more about FSO at msdn:
    http://msdn.microsoft.com/scripting/...jsFSOTutor.htm
    ________________________
    Fredrik Klarqvist

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width