Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Doubt

azeem_isazeem_is Member Posts: 14
Hai to all,
My Question is "Can We Modify a Text File in the Hard Disk with the help of Script(it may be any script). If we can, what send me the details." Please answer to my question.

Comments

  • gaspardgaspard Member Posts: 14
    : Hai to all,
    : My Question is "Can We Modify a Text File in the Hard Disk with the help of Script(it may be any script). If we can, what send me the details." Please answer to my question.
    :


    JavaScript is protected from modifying hard drive files, but I believe there may be a way to get around it... NOT SURE on that one..

    otherwise, an easy way is via a web server, say IIS 5, and running a VB or J script, like:



    (VBSCRIPT in ASP)

    [code]<%
    'How to write to a textfile example
    '
    '(c) 2001 Programmers Heaven
    http://www.programmersheaven.com


    const ForAppending=8
    const TristateFalse=0

    dim f,fsobj,filename

    'Create a filesystem object
    Set fsobj = CreateObject("Scripting.FileSystemObject")

    'The path and filename to write to
    filename="c: estfile.txt"

    'Open the textfile, create a new if it does not already exist
    Set f = fsobj.OpenTextFile(filename, ForAppending,true,TristateFalse)

    'Write to textfile
    f.Writeline "This is a test!"

    'Close the file
    f.Close

    'Free the objects
    set f=nothing
    set fsobj=nothing
    %>[/code]


Sign In or Register to comment.