Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'***************************************************************************
'****Ftp's whatever single file that has been dragged to the script icon****
'****This id for BA OUT ****************************************************
'***************************************************************************
user = "username"
pass = "pass"
ip = "ftpserverIP"
Set fs = CreateObject("Scripting.FileSystemObject") 'file withthe commands for ftp
Set objArgs = WScript.Arguments
if objArgs.Count <> 1 then
msgbox "Only Single file send. Try again."
else
strPath = wscript.ScriptFullName
name = objArgs(0)
Set a = fs.CreateTextFile("G:\babar\leifftp.com", True)
a.WriteLine (user)
a.WriteLine (pass)
'a.WriteLine ("bin")
'a.writeline ("CD 'MAILBOX.PASSAPPL.TD.TDX10CD1'")
a.WriteLine ("send " & name & " 'MAILBOX.PASSAPPL.TD.TDX10CD1'")
a.WriteLine ("quit")
a.Close
end if
Set fs = CreateObject("Scripting.FileSystemObject") 'file to run ftp with the commands above
Set a = fs.CreateTextFile("G:\babar\aaaa.cmd", True)
a.WriteLine ("ftp -i -s:G:\babar\leifftp.com " & ip)
a.Close
WshShell.Run "G:\babar\aaaa.cmd",0,true
'Option Explicit
'const progname="FTP upload script by Richard Finegold"
'const url = "ftp://ftp.myftpsite.com"
'const rdir = "mydir"
'const user = "anonymous"
'const pass = "myname@mymailsite.com"
'This is an example of ftp'ing without calling the external "FTP" command
'It uses InetCtrls.Inet.1 instead
'Included is a "hint" for simple downloading
'Sources:
'[URL unfurl="true"]http://msdn.microsoft.com/library/partbook/ipwvb5/loggingontoftpserver.htm[/URL]
'[URL unfurl="true"]http://msdn.microsoft.com/library/partbook/egvb6/addinginternettransfercontrol.htm[/URL]
'[URL unfurl="true"]http://cwashington.netreach.net/[/URL] - search on "ftp" - inspiration only!
'Insist on arguments
dim objArgs
Set objArgs = Wscript.Arguments
If 0=objArgs.Count Then
MsgBox "No files selected for operation!", vbOkOnly + vbCritical, progname
WScript.Quit
End If
'Force console mode - csforce.vbs (with some reorganization for efficiency)
dim i
if right(ucase(wscript.FullName),11)="WSCRIPT.EXE" then
dim args, y
For i = 0 to objArgs.Count - 1
args = args + " " + objArgs(i)
Next
Set y = WScript.CreateObject("WScript.Shell")
y.Run "cscript.exe " & wscript.ScriptFullName + " " + args, 1
wscript.quit
end if
'Do actual work
dim fso, ftpo
set fso = WScript.CreateObject("Scripting.FileSystemObject")
set ftpo = WScript.CreateObject("InetCtls.Inet.1") 'Msinet.ocx
ftpo.URL = url
ftpo.UserName = user
ftpo.Password = pass
WScript.Echo "Connecting..."
ftpo.Execute , "CD " & rdir
do
' WScript.Echo "."
WScript.Sleep 100 'This can take a while loop while ftpo.StillExecuting
for i = 0 to objArgs.Count - 1
dim sLFile
sLFile = objArgs(i)
if (fso.FileExists(sLFile)) then
WScript.Echo "Uploading " & sLFile & " as " & FSO.GetFileName(sLFile) & " "
ftpo.Execute , "Put " & sLFile & " " & FSO.GetFileName(sLFile)
'ftpo.Execute , "Get " & sRemoteFile & " C:\" & sLFile
do
'WScript.Echo "."
WScript.Sleep 100 'This can take a while
loop while ftpo.StillExecuting
else
MsgBox Chr(34) & sLFile & Chr(34) & " does not exist!", _
vbOkOnly, progname
end if
next
WScript.Echo "Closing"
ftpo.Execute , "Close"
WScript.Echo "Done!"
Set fs = CreateObject("Scripting.FileSystemObject") 'file to run ftp with the commands above
Set a = fs.CreateTextFile("G:\babar\aaaa.cmd", True)
a.WriteLine ("ftp -i -s:G:\babar\leifftp.com " & ip)
a.Close
[highlight]WshShell.Run "G:\babar\aaaa.cmd",0,true[/highlight]
echo open ftp.mantruckbus.co.uk > ftptest.txt
echo ddd\dddd >> ftptest.txt
echo ??????? >> ftptest.txt
echo lcd c:\ >> ftptest.txt
echo put zzzuni2man.csv >> ftptest.txt
echo bye >> ftptest.txt