Results 1 to 4 of 4

Thread: vbscript/server querstion

  1. #1

    Thread Starter
    Hyperactive Member Sacofjoea's Avatar
    Join Date
    May 2000
    Location
    Never Never Land
    Posts
    472

    vbscript/server querstion

    Ok, I know 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
    writeFile()
    MsgBox "Done!", vbOKONly
    </script>
    Saves on the client system, but how can I make my script save to the server's file? As well as read that file for later purposes??

    Thanks
    -Sac

  2. #2
    PowerPoster
    Join Date
    Nov 2001
    Location
    Trying to reach and stay in the cloud
    Posts
    2,089

    HI

    Keep everything same except add a runat=server attribute in the script tag.

  3. #3
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    The MSgBox part won't work though. No client side stuff can run at the server.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  4. #4
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Unless you have debugging enabled on the server in which it will allow msgbox to work (and stop the server until someone clicks the OK on the modal dialog).
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

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