Author Topic: VB Script File System Object (FSO)  (Read 6245 times)

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
VB Script File System Object (FSO)
« on: July 15, 2008, 10:07:51 AM »
Because using the FSO object in scripting is becoming more popular, I am adding a new section to the Scripting Help on the website for it.

http://www.icechat.net/site/index.php?irc-client=fso

I will be adding more information to it daily, so please do not expect it to be up and fully functional just quite yet :)
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: VB Script File System Object (FSO)
« Reply #1 on: July 19, 2008, 02:07:21 PM »
Can I Use FSO To Write HTML Files To A Website Through FTP?

I Tried Something Like This:

Code: [Select]
dim fs,fname
set fs=CreateObject("Scripting.FileSystemObject")
set fname=fs.CreateTextFile("ftp://user:pass@myftpserverhere/www/test.html",true)
fname.WriteLine("Hello World!")
fname.Close
set fname=nothing
set fs=nothing

And Got Errors Like This:
Code: [Select]
[16:05]  ->> ERROR:modScriptFunctions:fso.ice:Function:LoadScriptFile: Error Number:52 : Bad file name or number
Can I Do This? If So, What Did I Do Wrong?
~ Sam
~ Visit my website at http://www.TheCellist42.com

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: VB Script File System Object (FSO)
« Reply #2 on: July 19, 2008, 02:39:13 PM »
Simple answer, no.

You need to make an FTP Client to upload the file.
The IceChat God

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: VB Script File System Object (FSO)
« Reply #3 on: July 19, 2008, 02:41:25 PM »
ok
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: VB Script File System Object (FSO)
« Reply #4 on: July 20, 2008, 03:32:25 AM »
you can use windows ftp to upload the file. First make a textfile with this content, and save it as ftpscript.txt:
Code: [Select]
open address_goes_here
username
password
commands_to_run, like cd directory, etc
put filename_goes_here
quit

then make a .bat file with this content
Code: [Select]
ftp -s:ftpscript.txt
then use the 'RunShell' command to run the .bat file
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: VB Script File System Object (FSO)
« Reply #5 on: July 20, 2008, 11:41:05 AM »
thanks
~ Sam
~ Visit my website at http://www.TheCellist42.com