' Upload Files to an FTP Server

username="myusername"
pwd = "mypassword"
ftpsite="ftp.mysite.com"
local_folder = "c:\temp"
remote_folder="/www/"

currentdir = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName,"\")-1)

Set fso = CreateObject("Scripting.Filesystemobject")

Set file = fso.CreateTextFile(currentdir & "\ftp.txt",1)
file.WriteLine username
file.WriteLine pwd
file.WriteLine"Binary"
file.WriteLine"lcd """ & local_folder & """"
file.WriteLine"cd " & remote_folder

Foreach filenameIn fso.GetFolder(local_folder).Files
  file.WriteLine"put " & filename.Name
Next

file.WriteLine"bye"
file.Close

Set WshShell = CreateObject("wscript.Shell")
WshShell.Run"cmd.exe /c ftp.exe -i -s:" & currentdir & "\ftp.txt " & ftpsite & " >" & currentdir & "\ftp.log 2>&1",1,True

search for scripts

VbsEdit contains all these sample scripts!


Download Now!



Download   Home   Scripts

Copyright © 2001-2024 adersοft